Flyweight

Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Client: Code that uses the flyweight implementation Concrete Flyweight: A class that actually implements the abstract class/interface flyweight. Extrinsic State: State that is not common to the flyweights and varies per instance. Continue reading

Factory Method

Quick Information/Overview Pattern Type Creational Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Moderate — slightly easier than Abstract Factory Up Front Definitions Creator: This is the basic, abstract factory interface. Concrete Creator: Inheritor factory classes that implement some actual object creation scheme. Product: This is the base/abstract polymorphic Continue reading

Decorator

Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Decorator: An object that is both an inherits from and operates on another object. Component: Abstract target base class (or interface) of the decorator pattern. Target: For the purposes of this post, Continue reading

Composite

Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions Component: This is the abstract object that represents any and all members of the pattern Composite: Derives from component and provides the definition for the class that contains other components Leaf: Continue reading

Command

Quick Information/Overview Pattern Type Behavioral Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy – Moderate Up Front Definitions Invoker: This object services clients by exposing a method that takes a command as a parameter and invoking the command’s execute Receiver: This is the object upon which commands Continue reading

Chain of Responsibility

Quick Information/Overview Pattern Type Behavioral Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Easy Up Front Definitions N/A The Problem Let’s say that you’re doing something reasonably standard. You have some desktop application that deals with a persistence structure (file, web service, remote database, whatever) and displays things Continue reading

Builder

Quick Information/Overview Pattern Type Creational Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Relatively easy. Up Front Definitions Here are terms that I’ll be using in this explanation and what they mean: Composite: This is another design pattern, but I’m using it here to mean an object that Continue reading

Bridge

Quick Information/Overview Pattern Type Structural Applicable Language/Framework Agnostic OOP Pattern Source Gang of Four Difficulty Somewhat complex to grasp, moderate to implement. Up Front Definitions There are no special definitions that I’ll use here not defined inline. The Problem The iconic example of a situation in which the Bridge pattern Continue reading