Open post

Proxy

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

Purpose

Allows for object level access control by acting as a pass through entity or a placeholder object.

Use When

  • The object being represented is external to the system.
  • Objects need to be created on demand.
  • Access control for the original object is required.
  • Added functionality is required when an object is accessed.
Import into your Project
Open post

Flyweight

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

Purpose

Facilitates the reuse of many fine grained objects, making the utilization of large numbers of objects more efficient.

Use When

  • Many like objects are used and storage cost is high.
  • The majority of each object's state can be made extrinsic.
  • A few shared objects can replace many unshared ones.
  • The identity of each object does not matter.
Import into your Project
Open post

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

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

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

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

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

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

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

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

Posts navigation

1 2 3 14 15 16 17 18 19 20 45 46 47