<DS/>DS_VISUALIZER
FoundationsOOPArraysLinked ListStacksQueuesTreesGraphsHashingStrings
exploreExplore
homechevron_rightTopicschevron_rightOopschevron_rightDesign Patterns
extension

OOP · PATTERNS

Design Patterns

Battle-tested solutions — Singleton, Factory, Observer, Strategy, Decorator.

Choose a pattern

looks_onearrow_outward

Singleton

One instance, globally reachable — lazily created.

◍ 0/6
precision_manufacturingarrow_outward

Factory Method

Let a factory decide which object to create.

◍ 0/6
podcastsarrow_outward

Observer

One subject changes; every subscriber hears about it.

◍ 0/6
swap_callsarrow_outward

Strategy

Swap the algorithm object at runtime.

◍ 0/6
layersarrow_outward

Decorator

Wrap objects in objects — stack behaviour like layers.

◍ 0/6