Open main menu

Wikimedia Commons β

Software design patterns

general reusable solution to a commonly occurring problem within a given context in software design

Design patterns is a general reusable solution to some commonly occurring problem in software design.


Creational patternsEdit

Creational patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.

Abstract factoryEdit

The abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme.

Factory methodEdit

the Factory method pattern deals with the problem of creating objects (products) without specifying the exact class of object that will be created.

Builder patternEdit

The Builder pattern separate the construction of a complex object from its representation so that the same construction process can create different representations

Prototype patternEdit

Prototype pattern is used when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects

More examplesEdit

  • Lazy initialization pattern is the tactic of delaying the creation of an object, the calculation of a value, or some other expensive process until the first time it is needed
  • Object pool is a set of initialised objects that are kept ready to use, rather than allocated and destroyed on demand
  • Singleton pattern restrict instantiation of a class to one object

Structural patternEdit

Structural Design Patterns ease the design by identifying a simple way to realize relationships between entities.

Adapter patternEdit

The adapter pattern adapts one interface for a class into one that a client expects

Bridge patternEdit

The bridge pattern decouple an abstraction from its implementation so that the two can vary independently.

Composite patternEdit

The composite pattern is a tree structure of objects where every object has the same interface.

More examplesEdit

Behavioral patternEdit

behavioral design patterns identify common communication patterns between objects and realize these patterns.

Strategy patternEdit

The strategy pattern defines a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

Template method patternEdit

The template method pattern describes the program skeleton of a program in an operation, deferring some steps to subclasses.

More examplesEdit

Concurrency patternEdit

Leaders followers patternEdit