45. C-sharp 12-08-2014

Created Tuesday 12 August 2014

1) Design Patterns - practical solutions
2) OO Design Principles

SOLID - implemented through Design Patterns


Programming asp.net mvc 4

Single Responsibility Principle - SRP

One responsibility per class

Open/Closed Principle - OCP

Open for extension, closed for modification

Liskov Substitution Principle - LSP

Objects should be easily replaceable by instances of their subtypes without influencing other

Interface Segregation Principle - ISP

Instead of one superclass interface that contains all the behavior for an object, there should exist multiple, smaller, more specific interfaces

Dependency Injection Principle - DIP

Dependency Injection implemented through Inversion Of Control (IOC)


Dependency Injection Demystified
In short: DI means giving an object its instance variables

Composition Root - класс, в котором создаются все объекты, которые инжектируются в другие объекты, отсюда - Composition Root Pattern