Software Design Patterns

Vasu Vanka
2 min readDec 4, 2020

--

There are multiple ways to design and develop a software product.
Will Explain 3 major software design patterns in this post.

design patterns are useful to achieve error free and best flow of data to a software product.

  1. Class / Object Creational Pattern
  2. Adapter Pattern
  3. Template Pattern

Class / Object Creational Pattern :

Class / Object creational pattern can be referred as Creational Patterns. This pattern all about creation of object or class instance based on given requirement. find the scenarios where we can use this pattern.

Scenario 1: Create a class instance to maintain database connection between your application and DB. Creating a database connection for every database query is very expensive operation which will cause latency in response and uses unnecessary threads.
Here we will maintain Single database connection through out the application , this approach known as Singleton pattern.

Creational design patterns are the Factory Method, Abstract Factory, Builder, Singleton, Object Pool, and Prototype.

Adapter Pattern :

Adapter pattern also known as structural pattern. This is used when we have distinct interfaces and have to establish a relation / communication between them.

Scenario 1: When you have a database API interface and 3rd Party API interface and you have to establish communication between then by maintaining a class instance which will take care of data handling from both the ends.

Structural design patterns are Adapter, Bridge, Composite, Decorator, Façade, Flyweight, Private Class Data, and Proxy.

Template Pattern :

Template patterns also known as Behavior Pattern. This pattern about identifying common communication patterns between objects and realize these patterns.

Template pattern provides set of processing steps or a process defined template. User uses this template pattern as bare bone of the product to achieve desired functionality.

Template pattern can be extended without modifying existing flow.

Template patterns are Chain of responsibility, Command, Interpreter, Iterator, Mediator, Observer, State, Strategy, Template method, Visitor

If you like the post please tap on clap.

--

--

Vasu Vanka
Vasu Vanka

No responses yet