Learning path 5 of 6 · Intermediate
Hands-on: patterns with live demos
Five patterns with an interactive playground and a code sample in every language: the fastest way to see patterns at work.
0 of 5 lessons complete
- 1Factory Method
Defines an interface for creating an object but lets subclasses decide which class to instantiate.
- 2Singleton
Ensures a class has only one instance and provides a global access point to it.
- 3Decorator
Attaches new behaviours to objects by placing them inside wrapper objects that share the same interface.
- 4Observer
Defines a subscription mechanism that notifies multiple objects about events in the object they observe.
- 5Strategy
Defines a family of algorithms, puts each in its own class, and makes them interchangeable.