This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Tokenizer interface | |
| /// </summary> | |
| public interface ITokenizer | |
| { | |
| /// <summary> | |
| /// Generates the specified size. | |
| /// </summary> | |
| /// <param name="size">The size.</param> | |
| /// <returns></returns> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The Inversion of Control,(IoC) pattern is all about removing dependencies from your code, means, management of create instance with application framework. | |
| So how is the process of injecting dependencies? Hence some people says IoC Container and some people says Depency Injection(DI) container but both terms indicate to the same thing. | |
| What is Depency Injection? | |
| Dependency Injection, which is the last of the SOLID policies, as I mentioned above, the level difference classes (high-low) injects its dependencies from the outside. | |
| Let's try to explain with an example; | |
| public class ProductManager | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace Calculator | |
| { | |
| public class AddCommand :ICommand | |
| { | |
| private readonly double _firstNumber; | |
| private readonly double _secondNumber; | |
| public AddCommand(double firstNumber, double secondNumber) | |
| { | |
| _firstNumber = firstNumber; |