design patterns: elements of reusable object- orientated software gamma, helm, johnson, vlissides...
TRANSCRIPT
![Page 1: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/1.jpg)
Design Patterns: Elements of Reusable Object-
Orientated SoftwareGamma, Helm, Johnson, Vlissides
Presented By: David Williams
![Page 2: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/2.jpg)
What is a Design Pattern?
• Created by Christopher Alexander
• Abstracts the key aspects of a common design structure
• MVC is an early example of design pattern use
![Page 3: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/3.jpg)
Why Use Design Patterns?
• Gives developers a common language to use to discuss software design
• Helps:– Determine object granularity– Specify object interfaces– Specify object implementation– Encourage reuse
![Page 4: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/4.jpg)
Motivations Behind Patterns
• Classes are not types
• Class vs. interface inheritance
• Program to an interface, not an implementation
![Page 5: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/5.jpg)
How do Patterns Encourage Reuse?
• Inheritance vs. composition– White-box reuse vs. black-box reuse– Open-Closed Principle
• Inheritance vs. parameterized types
• Delegation
![Page 6: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/6.jpg)
Designing For Change
Don’t: Create an object by specifying its
class Depend on specific operations Depend on object implementations Depend on a specific algorithm Extend functionality by subclassing
![Page 7: Design Patterns: Elements of Reusable Object- Orientated Software Gamma, Helm, Johnson, Vlissides Presented By: David Williams](https://reader036.vdocuments.net/reader036/viewer/2022082411/5697bfd81a28abf838caf2d8/html5/thumbnails/7.jpg)
Conclusion
Using design patterns can:Facilitate communication and
understanding within a development teamIncrease the reuse of softwareAllow for software to be more easily
modified