Software Design Patterns and Principals

  1. Law of Demeter or principle of least knowledge
  2. A principle of good system design is SoC - separation of concerns
  3. The Hollywood Principle, which states: "don't call us, we'll call you". With a canonical approach, you hard code the classes of the objects you want to instantiate in the source of your application, supply parameters to their constructors and manage their interactions. Each object knows at compile time which are the real classes of the objects they need to interact with, and they will call them directly. So, under this point of view, you and your objects are the ones calling Hollywood. To invert this approach, you need some support from a framework which makes your application smart enough to guess which objects to instantiate, how to instantiate them and, in general, how to control their behavior.
  4. Inversion of Control (IoC)
  5. Dependency Injection (DI)