Dependency Injection in .NET Core 2.0 by Marino Posadas
Author:Marino Posadas
Language: eng
Format: epub
Tags: COM051200 - COMPUTERS / Programming Languages / Visual BASIC, COM051000 - COMPUTERS / Programming / General, COM051230 - COMPUTERS / Software Development And Engineering / General
Publisher: Packt
Published: 2017-11-08T11:16:06+00:00
If you understand cricket a little bit, you must know that a player uses a bat to bat. That means it depends on the bat object. The bat object, however, can be used by any batsman in the team, which leads to a StartPlay method in the Bat class. Obviously, the bat object needs to get associated with a player, which eventually commences the game.
Both of the objects depend on each other in order to start the game. They still exist as independent objects. Suppose, you don't call the Play and StartPlay method, nothing will change. The code will compile. That defines the association with each other for a common cause:
CricketPlayer cPlayer = new CricketPlayer("Hardik Pandya"); Bat bat = new Bat(); //cPlayer.Play(bat); //bat.StartPlay(cPlayer);
Console.WriteLine($"Name of the Player is: {
cPlayer.GetPlayerName() }");
Console.WriteLine($"Brand of Bat is: { bat.GetBrandName() }");
Here, I just commented out codes for play. That did not have any impact on the objects and they still exist. Then I used them to call other methods like GetPlayerName and GetBrandName.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12570)
Hello! Python by Anthony Briggs(9914)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9796)
The Mikado Method by Ola Ellnestam Daniel Brolund(9778)
Dependency Injection in .NET by Mark Seemann(9337)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7763)
Grails in Action by Glen Smith Peter Ledbrook(7696)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7557)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7072)
Microservices with Go by Alexander Shuiskov(6834)
Practical Design Patterns for Java Developers by Miroslav Wengner(6755)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6697)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6413)
Angular Projects - Third Edition by Aristeidis Bampakos(6099)
The Art of Crafting User Stories by The Art of Crafting User Stories(5628)
NetSuite for Consultants - Second Edition by Peter Ries(5562)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5369)
Kotlin in Action by Dmitry Jemerov(5062)
