Skip to content

Quick guide on design patterns with an example in java

Notifications You must be signed in to change notification settings

elieahd/design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design patterns

What is a design pattern ?

Reusable solution to a commonly occurring problem within a given context in software design.

It is not a finished design that can be transformed directly into source or machine code.

Rather, it is a description or template for how to solve a problem that can be used in many different situations.

Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

Creational

A design pattern that deals with creating object in a manner suitable to a situation

Design pattern Description
Factory creating objects without having to specify the exact class of the object that will be created
Builder constructing complex objects in a simplified manner
Singleton restricting the instantiation of a class to one "single" instance

Structural

A design pattern that deals with assembling objects and classes into a flexible and efficient structure

Design pattern Description
Adapter allowing objects with incompatible interfaces to collaborate
Composite composing objects into tree structures
Decorator attaching new behaviors to objects
Facade simplifying and restricting the code by a new wrapper class "facade"

Behavioural

A design pattern that deals with communications between objects

Design pattern Description
Command encapsulating in an object all data required to perform an action
Observer notifying observers about changes in its state
Strategy selecting an algorithm at runtime

About

Quick guide on design patterns with an example in java

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages