Skip to content

Instantly share code, notes, and snippets.

@hrndeger
hrndeger / Tokenizer
Created February 21, 2017 13:52
C# Tokenizer Generator
/// <summary>
/// Tokenizer interface
/// </summary>
public interface ITokenizer
{
/// <summary>
/// Generates the specified size.
/// </summary>
/// <param name="size">The size.</param>
/// <returns></returns>
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
{
@hrndeger
hrndeger / AddCommand.cs
Last active December 14, 2016 12:03
TDD Basic Example with Command Pattern
namespace Calculator
{
public class AddCommand :ICommand
{
private readonly double _firstNumber;
private readonly double _secondNumber;
public AddCommand(double firstNumber, double secondNumber)
{
_firstNumber = firstNumber;