Design patterns for architectural discovery analysis

The Design Patterns rule category for architectural analysis contains commonly seen solutions or pitfalls in designing and writing source code, including some of the classic Gang of Four patterns.

Purpose

The following table lists each pattern, and its purpose, in the Design Patterns category:

Pattern Purpose
Decorator The Decorator pattern adds responsibilities to an object dynamically, without changing its interface. The Decorator pattern acts as a wrapper because it implements the original interface, adds capabilities, and delegates work to the original object, so you can use it as an alternative to creating a subclass. The architectural discovery algorithm identifies this pattern as consisting of two classes: Decorator and the wrapped component.
Factory Method The Factory Method pattern defines an interface for creating objects without knowing the class of the object it creates. Each Factory Method pattern can define the class to be instantiated based on the input parameters and specifics of the situation. The architectural discovery algorithm identifies this pattern as consisting of Creator class, Concrete Creator subclass, Product interface, and Concrete Product object. The Creator class specifies the interface for creating a Product. The Concrete Creator subclass implements this interface by instantiating a Concrete Product object.
Marker The Marker pattern declares a semantic attribute of a class. The architectural discovery algorithm identifies the Marker pattern as a single empty interface without methods or constants.
Observer/Observable The Observer/Observable pattern communicates the changes in the state of an object to other system objects. The architectural discovery algorithm identifies this pattern as consisting of Observer and Observable. The Observable class maintains a list of Observer classes that it notifies when a state change occurs.
Singleton The Singleton pattern ensures that a class allows only one object instance. The architectural discovery algorithm identifies the Singleton pattern as a class with a private constructor and a public static field or method that provides global access to the instance of a Singleton class.
Utility The Utility pattern models a stateless utility function. The architectural discovery algorithm identifies Utility as a class with a private constructor that contains only static methods.
Visitor The Visitor pattern performs specific operations on the elements of an object structure. The Visitor pattern allows additional operations without changing the classes of the elements on which they operate. The architectural discovery algorithm identifies the Visitor pattern as consisting of Visitor class, Concrete Visitor subclass, Element (optional) class, and Concrete Element subclass. The Visitor pattern is an interface that declares the Visit operation for every element. The Concrete Visitor subclass implements the Visitor interface and acts on each Concrete Element subclass.