Structural
12 items tagged with "structural"
Patterns12
Adapter
Converts the interface of a class into another interface clients expect, letting classes that could not otherwise collaborate work together.
Bridge
Decouples an abstraction from its implementation so the two can vary independently, avoiding a combinatorial explosion of subclasses.
Composite
Composes objects into tree structures to represent part-whole hierarchies, letting clients treat individual objects and compositions uniformly.
Decorator
Attaches additional responsibilities to an object dynamically by wrapping it, providing a flexible alternative to subclassing for extending behavior.
Flyweight
Minimizes memory use by sharing as much data as possible between many similar objects, separating intrinsic shared state from extrinsic context-specific state.
Proxy
Provides a surrogate or placeholder for another object to control access to it, enabling lazy loading, access control, caching, or remote access.
Module
Encapsulates related code into a single self-contained unit with a controlled public interface and hidden private state, organizing code and avoiding global namespace pollution.
Marker Interface
Uses an empty interface to tag a class with metadata so other code can detect the capability at runtime via type checks, without adding any methods.
Mixin
Composes reusable units of behavior into a class without inheritance, letting unrelated classes share functionality by mixing in shared method sets.
Extension Object
Lets you add new interfaces and behavior to a class over time without changing it, by attaching extension objects that clients query for at runtime.
Private Class Data
Restricts accessor-write access to class attributes by isolating data in a separate object exposed read-only after construction, enforcing immutability and encapsulation.
Front Controller
Channels all incoming requests through a single handler that centralizes cross-cutting concerns like routing, authentication, and logging before dispatching to handlers.