Open post
Facade

Facade

This is a UML class diagram for the Facade design pattern.

Purpose

Supplies a single interface to a set of interfaces within a system.

Use When

  • A simple interface is needed to provide access to a complex system.
  • There are many dependencies between system implementations and clients.
  • Systems and subsystems should be layered.
Import into your Project
Open post
Decorator

Decorator

This is a UML class diagram example for the Decorator design pattern.

Purpose

Allows for the dynamic wrapping of objects in order to modify their existing responsibilities and behaviors.

Use When

  • Object responsibilities and behaviors should be dynamically modifiable.
  • Concrete implementations should be decoupled from responsibilities and behaviors.
  • Subclassing to achieve modification is impractical or impossible.
  • Specific functionality should not reside high in the object hierarchy.
  • A lot of little objects surrounding a concrete implementation is acceptable.
Import into your Project
Open post
Composite

Composite

This is a class diagram example for the Composite design pattern.

Purpose

Facilitates the creation of object hierarchies where each object can be treated independently or as a set of nested objects through the same interface.

Use When

  • Hierarchical representations of objects are needed.
  • Objects and compositions of objects should be treated uniformly.
Import into your Project
Open post
Bridge

Bridge

This is a UML class diagram example for the Bridge design pattern.

Purpose

Defines an abstract object structure independently of the implementation object structure in order to limit coupling.

Use When

  • Abstractions and implementations should not be bound at compile time.
  • Abstractions and implementations should be independently extensible.
  • Changes in the implementation of an abstraction should have no impact on clients.
  • Implementation details should be hidden from the client.
Import into your Project
Open post
Adapter

Adapter

This is a UML class diagram example for the Adapter design pattern.

Purpose

Permits classes with disparate interfaces to work together by creating a common object by which they may communicate and interact.

Use When

  • A class to be used doesn't meet interface requirements.
  • Complex conditions tie object behavior to its state.
  • Transitions between states need to be explicit.
Import into your Project
Open post
Singleton

Singleton

This is a UML class diagram example for the Singleton design pattern.

Purpose

Ensures that only one instance of a class is allowed within a system.

Use When

  • Exactly one instance of a class is required.
  • Controlled access to a single object is necessary.

Example

Most languages provide some sort of system or environment object that allows the language to interact with the native operating system. Since the application is physically running on only one operating system there is only ever a need for a single instance of this system object. The singleton pattern would be implemented by the language runtime to ensure that only a single copy of the system object is created and to ensure only appropriate processes are allowed access to it.

Import into your Project
Open post
Prototype

Prototype

This is a UML class diagram example for the prototype design pattern.

Purpose

Create objects based upon a template of an existing objects through cloning.

Use When

  • Composition, creation, and representation of objects should be decoupled from a system.
  • Classes to be created are specified at runtime.
  • A limited number of state combinations exist in an object.
  • Objects or object structures are required that are identical or closely resemble other existing objects or object structures.
  • The initial creation of each object is an expensive operation.
Import into your Project
Open post
Builder

Builder

This is a UML class diagram example for the builder design pattern.

Purpose

Allows for the dynamic creation of objects based upon easily interchangeable algorithms.

Use When

  • Object creation algorithms should be decoupled from the system.
  • Multiple representations of creation algorithms are required.
  • The addition of new creation functionality without changing the core code is necessary.
  • Runtime control over the creation process is required.
Import into your Project
Open post
Abstract Factory

Abstract Factory

This is a UML class diagram example for the abstract factory design pattern.

Purpose

Provide an interface that delegates creation calls to one or more concrete classes in order to deliver specific objects.

Use When

  • The creation of objects should be independent of the system utilizing them.
  • Systems should be capable of using multiple families of objects.
  • Families of objects must be used together.
  • Libraries must be published without exposing implementation details.
  • Concrete classes should be decoupled from clients.
Import into your Project
Open post
Factory Method

Factory Method

This is a UML class diagram for the factory method design pattern.

Purpose

Exposes a method for creating objects, allowing subclasses to control the actual creation process.

Use When

  • A class will not know what classes it will be required to create.
  • Subclasses may specify what objects should be created.
  • Parent classes wish to defer creation to their subclasses.
Import into your Project

Posts navigation

1 2 3 11 12 13 14 15 16 17 42 43 44