Don’t confuse DIP, IoC, and DI together. They are all different but related.

DIP (or Dependency Inversion Principle) is one of the principles of SOLID.  SOLID stands for: Single responsibility - a class should only have one responsibility Open / closed principle - a class should be open for extension but closed for modification Liskov substitution principle - a class should be replaceable without altering the functionality of the …

Continue reading Don’t confuse DIP, IoC, and DI together. They are all different but related.

Advertisements

Design Patterns: Factory Method, Abstract Factory, and Singleton

Back again with design patterns, defining them briefly and the design principles they are based on, and providing several very good (almost) real-world C# examples that are available on the Internet.  In this series we have the factory patterns and the singleton pattern and their several different implementations.   Design Pattern #4: Factory Method Pattern …

Continue reading Design Patterns: Factory Method, Abstract Factory, and Singleton

Design Patterns: Strategy, Observer, and Decorator

Here and in the next posts, I will talk about design patterns, it’s definition, the guiding design principles they embody, and their C# examples.  But before you dive into design patterns, here is a refresher on four OO basics.   Design Pattern #1: Strategy Pattern Defines a family of algorigthms, encapsulates each one, and makes …

Continue reading Design Patterns: Strategy, Observer, and Decorator

Design Patterns: The Four OO Basics

Before going into design patterns, one must need to know the four OO basics: Abstraction is showing only the necessary details to the outside world. It is the abstract form of anything. It is implemented using interface and abstract class. Encapsulation is hiding the details from the outside world. It is the opposite of abstraction. …

Continue reading Design Patterns: The Four OO Basics

Design Patterns: Fundamentals

Fundamental design patterns are divided into 3 categories: Creational Singleton Builder Prototype Abstract Factory Factory Method Behavioral Mediator Visitor Template Method Iterator Command Memento Observer Interpreter Chain of Responsibility State Strategy Structural Decorator Proxy Composite Facade Flyweight Bridge Adapter EDIT: The above patterns are called the 23 Gang of Four (GoF) patterns.  More information can be found from …

Continue reading Design Patterns: Fundamentals