Design Patterns: Elements of Reusable Object-Oriented Software – Book – Software-Pattern.org

Design Patterns: Elements of Reusable Object-Oriented Software is a software engineering book describing recurring solutions to common problems in software design. The book is divided into two parts, with the first two chapters exploring the capabilities and pitfalls of object-oriented programming, and the remaining chapters describing 23 classic software design patterns. The book includes examples in C++ and Smalltalk.

Instead of using numerous constructors, the builder pattern uses a builder object, that instantiates and initializes objects using a multiple of steps.

The bridge pattern is a design pattern that separates the abstract elements of a class from its technical implementation. This provides a cleaner implementation of real-world objects and allows the implementation details to be changed easily.

The adapter pattern is a design pattern that is used to allow two incompatible types to communicate. Where one class relies upon a specific interface that is not implemented by another class, the adapter acts as a translator between the two types.

An abstract factory offers the interface for creating a set of related or dependant objects without explicitly specifying their classes. The type of the created objects are determined at run-time.

Chain of Responsibility

Behavioral Pattern

The chain of responsibility pattern is a design pattern that defines a linked list of handlers, each of which is able to process requests. When a request is submitted to the chain, it is passed to the first handler in the list that is able to process it.

Command

Behavioral Pattern

A command object encapsulates a request as an object. This object is sent to a receiver which executes the command. The advantage of this technique is that the requests can be queued, logged or implemented to support undo/redo.

Composite

Structural Pattern

The composite pattern describes a way to create tree structures using objects and object groups. The clients can access and use individual objects and compositions in the same manner.

Decorator

Structural Pattern

A decorator allows to add behavior to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.