Forem

Hanane Kacemi
Hanane Kacemi

Posted on • Edited on

Notes about design patterns

Design patterns are practical proven solutions to recurring design problems. They are blueprints not algorithms or code to solve a common software problems.

It's important to note that it won't be so simple to look at a software design problem and automatically know which design pattern to use.

Design patterns are categorized into 3 groups :
Creational Patterns : provide mecanisms for object creation which increase flexibility and reuse of existing code. Example : Factory Pattern, Builder Pattern, Singleton...
Structural Patterns : Describe how objects are connected to each other, example : Adapter Pattern, Decorator Pattern, Facade...
Behavioral Patterns : how objects distribute work and how they work towards a common goal.

Design patterns help to have a common design vocabulary between developers. Rather than having to explain the details of a design solution you can simplify the discussion by having a suggestive word to describe it.

One of the design principles is to identify the aspects of application that varies and separate them from what stays the same. With this approach we won't have to make changes in different places when a new request is made by the client, that minimize the amount of bugs that can be introduced by the change and it makes the code flexible.

*1. Strategy pattern : *
Define a family of algorithms encapsulates each other and make them interchangeable. Strategy lets the algorithm vary independently from client that use it

Strategy-pattern-example

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay