Classic Design Patterns

 

Here are the "classic" design patterns as described by the Gang of Four (GoF). Their work describes the fundamental patterns that are encountered in traditional Object-Oriented programming. Mostly likely, when you hear about design patterns in conversation, these are what are being referred to. Design Patterns: Elements of Reusable Object-Oriented Software is the first and probably the most famous book about the Design pattern. It was first published in 1995, but thankfully those design patterns are still valid and in common use today, the only outdated thing in this book may be the original Smalltalk programming language, used in some examples.

As in their classic book, I break the patterns down into simple categories: Creational, Structural, and Behavioral - only here, I use samples in a number of languages in more common use today. The pages here represent a summary of their fantasic work; but, provide enough detail to begin using them in your everyday work.

constructional patterns

CLASSIC CONSTRUCTIONAL DESIGN PATTERNS - GANG OF FOUR

These design patterns are all about class creation and instantiation. These patterns are often further divided into class-creation patterns and object-creational patterns.

The primary difference between the two types are that while class-creation patterns use inheritance effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.

 
structural patterns

CLASSIC STRUCTURAL DESIGN PATTERNS - GANG OF FOUR

These design patterns are all about Class and Object composition - how things are built and how they interact. Essentially they describe the basic manners in which objects realize relationships between entities and each other.

Structural class-creation patterns use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to obtain new functionality.

 
behaviorial patterns

CLASSIC BEHAVIORIAL DESIGN PATTERNS - GANG OF FOUR

These design patterns are all about how objects communicate with each other and the world around them. Behavioral patterns are those patterns that are most specifically concerned with communication between objects.

Behavioral patterns are typically also concerned with the assignment of responsibilities between objects, or, encapsulating behavior in an object and delegating requests to it.