Decorator Pattern
decorator pattern is a design pattern that allows new/additional behaviour to be added to an existing object dynamically. The decorator pattern can be used to make it possible to extend (decorate) the functionality of a certain object at runtime, independently of other instances of the same class, provided some groundwork is done at design time.
Strategy Pattern
strategy pattern (also known as the policy pattern) is a particular software design pattern, whereby algorithms can be selected at runtime.
The strategy pattern is intended to provide a means to define a family of algorithms, encapsulate each one as an object, and make them interchangeable. The strategy pattern lets the algorithms vary independently from clients that use them
Example
Implementation of different types of sorting technologies
Factory pattern
Abstract Factory pattern
No comments:
Post a Comment