Platinum Partner
java,patterns,design patterns,design patterns uncovered

Design Patterns Uncovered: Tutorial Series Overview

Learn the Gang of Four Design Patterns with easy Java source code examples in James Sugrue's design patterns tutorial series, Design Patterns Uncovered

Last week we completed the last of the 23 part design pattern series. This article brings all of those patterns together for your reference.

Design Patterns Refcard
For a great overview of the most popular design patterns, DZone's Design Patterns Refcard is the best place to start. 


 

Creational Patterns 

Used to construct objects such that they can be decoupled from their implementing system.

  • Chain of ResponsibilityGives more than one object an opportunity to handle a request by linking receiving objects together. 



  • Command
    Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations
  • Interpreter
    Given a language, define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language.



  • Iterator
    Provides a way to access the elements of an aggregate object without exposing its underlying representation.


  • Mediator
    Allows loose coupling by encapsulating the way disparate sets of objects interact and communicate with each other.  Allows for the actions of each object set to vary independently of one another. 


  • Memento
    Captures and externalizes an object's internal state so that it can be restored later, all without violating encapsulation.


  • Observer
    Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.



  • State
    Allows an object to alter its behaviour when its internal state changes. The object will appear to change its class.


  • StrategyDefines a set of encapsulated algorithms that can be swapped to carry out a specific behaviour

  • Template Method
    Defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithms structure.

  • Visitor
    Allows for one or more operation to be applied to a set of objects at runtime, decoupling the operations from the object structure. 


Structural Patterns 

Used to form large object structures between many disparate objects.

  • Adapter
    Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.


  • BridgeDecouple an abstraction from its implementation so that the two can vary independently

  • Composite
    Allows you to compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. 


  • Decorator
    Allows for the dynamic wrapping of objects in order to modify their existing responsibilities and behaviours

  • Facade
    Provide a unified interface to a set of interfaces in a subsystem. Fa├žade defines a higher-level interface that makes the subsystem easier to use.


  • Flyweight
    Facilitates the reuse of many fine grained objects, making the utilization of large numbers of objects more efficient.


  • Proxy
    Allows for object level access control by acting as a pass through entity or a placeholder object.

Behavioral Patterns

Used to manage algorithms, relationships and responsibilities between objects. 

  • Abstract Factory
    Provides an interface for creating families of related or dependent objects without specifying their concrete classes.


  • BuilderAllows for object level access control by acting as a pass through entity or a placeholder object. 

  • Factory Method
    Define an interface for creating an object, but let the subclasses decide which class to instantiate. The Factory method lets a class defer instantiation to subclasses

  • Prototype
    Create objects based on a template of an exsiting object through cloning.



  • SingletonEnsure a class has only one instance and provide a global point of access to it.


Design Patterns Refcard
For a great overview of the most popular design patterns, DZone's Design Patterns Refcard is the best place to start. 


 

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}