Skip to content

NehaChitkara/Design-Patterns-Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Design-Patterns

Design Patterns are design level, reusable solutions to common problems software engineers face. These have been well-tested by numerous developers, and have been known to speed up development process. Design patterns make it easier for developers talk about the general solutions during the development of the software.

Some common design patterns are as depicted in the picture Design patterns in java

  • Creational - How to create the object
  • Structural - How to assemble objects into larger structures
  • Behavioral - How to build and control data flows

Creational Design Patterns

Creational design patterns are concerned with creation of the object Some creational design patterns are described below:

  • Singleton - Only single instance of the class can exist
  • Factory - Creates one instance for several derived classes
  • Abstract Factory - Creates one instance for several families of derived classes
  • Builder - Separates object construction from it's representation. Optional parameters are set through the builder class
  • Prototype - Fully initialized object to be cloned or copied

Structural Design Patterns

Structural design patterns are concerned with assembling objects into larger structures, while maintaining flexibility Some structural design patterns are described below:

  • Adapter - Allows objects with incompatible interfaces to collaborate
  • Bridge - Allows to decouple an abstraction from its implementation so that the two can vary independently.
  • Composite - A tree structure of simple and composite objects.
  • Decorator - Allows to add responsibilities to objects dynamically.
  • Facade - Allows to add responsibilities to objects dynamically.
  • Flyweight - A fine-grained instance used for efficient sharing.
  • Proxy - An object representing other object.

Behavioral Design Patterns

Behavioral design patterns are concerned with the behavior and data flow between objects Some behavioral design patterns are described below:

  • Observer - When one object changes state, the others observing the object are notified and updated automatically
  • Chain of Responsibility -A way of passing a request between a chain of objects.
  • Command - Encapsulate a command request as an object.
  • Iterator - When iterator is defined to traverse and access the container's elements.
  • Mediator - Facilitates loosely coupled communication between multiple objects and thus, reduce dependency between them.
  • Memento - Allows going-back to the previous state of an object (Undo via rollback).
  • State - Allows an object to alter it's behavior when it's state changes.
  • Template - Defines template of algorithm in superclass and allows subclasses to override specific steps without changing it's structure.
  • Visitor - Separates an algorithm from an object structure on which it operates.
  • Interpreter - Defines a grammatical representation for a language and provides an interpreter to deal with this grammar.

About

The repository implements some of the most used design patterns

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages