Design Pattern

Introduction to Design Pattern

Design Patterns are models of code that solve classic problems. They are solutions to software design problems that you can find in a real-world application. A Design Pattern is not a code that is ready to be used in your application, but it is a model that you can use to solve a problem.

Design patterns are language neutral, so they can be applied to any language that supports object-orientation.

List well-known Design Patterns


It is worth noticing that there is no homogeneous division of design patterns and, usually, there are as many of them as studies on this subject. For the purpose of this article we use the division proposed by the Gang of Four:

  • Creational patterns
  • Structural patterns
  • Behavioural patterns

Each design pattern is suitable for a determined situation. Used in an improper scenario they may do more harm than good!

In this article, we will limit ourselves to selected patterns which will represent given categories proposed by the Gang of Four.

Introduction for selected Design pattern

CREATIONAL PATTERNS

Creational patterns are associated with control mechanisms of creating objects. The basic mode of forming an object may be problematic in some projects and may lead to unnecessary complexity in some areas. Creational patterns are supposed to prevent from occurring problems and introduce more control over creating objects. Their task is to separate the processes of creation, completion and representation of an object.

There are five well-known design patterns possible to implement in a wide scope of programming languages:

  • Abstract Factory Pattern
  • Builder Pattern
  • Factory Method Pattern
  • Prototype Pattern
  • Singleton Pattern

  • Example of Implementation based on the selected Design Pattern

  • abstract factory software pattern :- 

    class requests the objects it requires from a factory object instead of creating the objects directly

Comments

Popular posts from this blog

Name Compatibility Privacy Policy

Horoscope Compatibility Privacy policy