Last week
Previous question: SRP vs ISP in SOLID
SRP (Single Responsibility Principle)
ISP (Interface Segregation Principle)
Last week
Last week
Last week
Today’s agenda
Structural design patterns
Structural patterns
Structural patterns
Adapter
Adapter
Adapter - real world example
Bridge
Bridge
Differences between Adapter and Bridge
Composite
Composite
Composite example
Although the example is abstract, arithmetic expressions are Composites.
An arithmetic expression consists of an operand, an operator (+ - * /), and another operand.
The operand can be a number, or another arithmetic expression. Thus, 2 + 3 and (2 + 3) + (4 * 6) are both valid expressions.
Decorator
Decorator
Decorator
Decorator
Decorator
Differences between Composite and Decorator
Facade
Facade
Proxy
Proxy