Pattern: – The Design Principle

Pattern defined as regular arrangement of repeated same elements i.e. line, shape, colors over and over again. The patterns typically show relationships and interactions between classes or objects. The idea is to speed up the development process by providing well tested, proven development/design paradigm. 

Design patterns are programming language independent strategies for solving a common problem. That means a design pattern represents an idea, not a particular implementation. By using the design patterns you can make your code more flexible, reusable and maintainable.

Uses of Design Patterns

Design patterns can speed up the development process by providing tested, proven development paradigms. Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.

Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that doesn’t require specifics tied to a particular problem.

Types of Design Patterns

There are mainly three types of design patterns:

  • Creational
    These design patterns are all about class instantiation or object creation. This can be further categorized into Class-creational and object-creational patterns. While class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.
  • Structural
    These design patterns are about organizing different classes and objects to form larger structures and provide new functionality. Structural design patterns are Adapter, Bridge, Composite, Decorator, Façade, Flyweight, Private Class Data, and Proxy.
  • Behavioral
    These patterns are about identifying common communication patterns between objects and realize these patterns. Behavioral patterns are Chain of responsibility, Command, Interpreter, Iterator, Mediator, Memento, Null Object, Observer, State, Strategy, Template method, Visitor

Conclusion

Design pattern collect design knowledge and improve communication. They are micro-architecture, they cannot ensure a good overall architecture. They do not cover all design decisions, creativity is still needed.