Software design patterns

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

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

Creational patterns

[edit]

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

Abstract factory

[edit]

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

Factory method

[edit]

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

Builder pattern

[edit]

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

Prototype pattern

[edit]

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 examples

[edit]
  • 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 pattern

[edit]

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

Adapter pattern

[edit]

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

Bridge pattern

[edit]

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

Composite pattern

[edit]

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

More examples

[edit]

Behavioral pattern

[edit]

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

Strategy pattern

[edit]

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 pattern

[edit]

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

More examples

[edit]


Concurrency pattern

[edit]

Concurrency patterns are one of the types of design patterns. Examples of this class of patterns include:


Leaders followers pattern

[edit]

Examples of this class of patterns include: