Software Design and Architectural Patterns


Architectural Pattern

A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection. Client objects construct query specifications declaratively and submit them to Repository for satisfaction. Objects can be added to and removed from the Repository, as they can from a simple collection of objects, and the mapping code encapsulated by the Repository will carry out the appropriate operations behind the scenes.

Scoped Locking

Synchronization Pattern

The Scoped Locking C++ idiom ensures that a lock is acquired when control enters a scope and released automatically when control leaves the scope, regardless of the return path from the scope.

Service Locator

Structural Pattern

The service locator pattern encapsulates the processes involved in obtaining a service with a strong abstraction layer. The pattern uses a central registry known as the "service locator", which on request returns the information necessary to perform a certain task. The pattern is often considered an anti-pattern, because it hides the dependencies of class (in contrast to constructor injection).


Creational Pattern

A singleton is an object whose class can only have one instance. A singleton class ensures that only one instance of the class can be created. The pattern is often called an anti-pattern because it may lead to high coupling of components.


Behavioral Pattern

The Sponsor-Selector pattern can be used to provide a mechanism for selecting the best resource for a task from a set of resources that changes dynamically. It allows a software system to integrate new resources, and new knowledge about resources, at run-time in a way that is transparent to users of the resources. This pattern is based on the idea of separating three kinds of responsibilities: knowing when a resource is useful, selecting among resources, and using a resource.


Behavioral Pattern

The state pattern is used to alter the behaviour of an object as its internal state changes. The pattern allows the class for an object to apparently change at run-time.

Strategized Locking

Synchronization Pattern

The Strategized Locking design pattern parameterizes synchronization mechanisms that protect a component's critical sections from concurrent access.


Behavioral Pattern

The strategy pattern is used to create an interchangeable family of algorithms from which the required process is chosen at run-time.

Template Method

Behavioral Pattern

The template method pattern is used to define the basic steps of an algorithm and allow the implementation of the individual steps to be changed.

Thread-Safe Interface

Synchronization Pattern

The Thread-Safe Interface design pattern minimizes locking overhead and ensures that intra-component method calls do not incur `self-deadlock' by trying to reacquire a lock that is held by the component already.

Thread-Specific Storage

Concurrency Pattern

The Thread-Specific Storage design pattern allows multiple threads to use one `logically global' access point to retrieve an object that is local to a thread, without incurring locking overhead on each object access.

Type Object

Structural Pattern

Decouple instances from their classes so that those classes can be implemented as instances of a class. Type Object allows new "classes" to be created dynamically at runtime, lets a system provide its own type‚ąíchecking rules, and can lead to simpler, smaller systems.

View Handler

Architectural Pattern

The View Handler design pattern helps to manage all views that a software system provides. A view handler component allows clients to open, manipulate and dispose of views. It also coordinates dependencies between views and organises their update.


Behavioral Pattern

The visitor pattern is used to separate a relatively complex set of structured data classes from the functionality that may be performed upon the data that they hold.


Structural Pattern

The Whole-Part design pattern helps with the aggregation of components that together form a semantic unit. An aggregate component, the Whole, encapsulates it constituent components, the Parts, organises their collaboration, and provides a common interface to its functionality. Direct access to the Parts is not possible.

Wrapper Facade

Configuration Pattern

The Wrapper Facade design pattern encapsulates low-level functions and data structures within more concise, robust, portable, and maintainable object-oriented class interfaces.