OO Design Patterns

Design patterns in OOP(Object Oriented Programming) world.

What is a design pattern?

A design patterns is a repeatable solution to a commonly occurring problem in software design. It serves as a guideline or template for how to solve a problem but not a finished design that can be transformed directly into code.

What benefits does design patterns bring?

What types of design patterns do we have?

Creational design patterns

These patterns are templates for how to instantiate object, and can be divided into class-creation patterns and object-creation patterns.

Structural design patterns

Structural design patterns are focusing on class and object composition, or in other words, relationship between entities. Structural class-creation patterns use inheritance to compose interfaces. Meanwhile, structural object-patterns define ways to compose objects to obtain new functionality.

Behavior design patterns

These design patterns are all about objects communication.They identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.

What should we care when applying a design pattern?