Decorator Pattern in Software Design

week 4 day 3 observer n.w
1 / 13
Embed
Share

Explore the concepts of Observer Decorators, Inheritance Models, and Coffee Design Patterns in software development. Dive into the principles, advantages, and downsides of using decorators in your projects. Develop a solid understanding of when and how to implement decorators effectively.

  • Software Design
  • Decorator Pattern
  • Observer Decorators
  • Inheritance Models
  • Design Principles

Uploaded on | 1 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Week 4, Day 3: Observer Decorators Muddiest Point Half Exam 1 on Thursday SE-2811 1 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder

  2. Coffee Inheritance Model Design Review Any potential changes? Keep current design? SE-2811 2 Dr. Mark L. Hornick

  3. Time for Coffee 2.0 Want to be able to add, Whip, Mocha, DarkRoast, etc. to our coffee Exercise: With your team, create a design to include these decorators and have the cost function return their cost SE-2811 3 Dr. Mark L. Hornick

  4. One approach: Inheritance SE-2811 4 Dr. Mark L. Hornick

  5. Cleaned up with decorator pattern SE-2811 5 Dr. Mark L. Hornick

  6. Cost of DarkRoast with Whip and Mocha cost() cost() cost() 0.10 0.20 0.99 $1.29 DarkRoast Mocha Whip SE-2811 6 Dr. Mark L. Hornick

  7. General Pattern SE-2811 7 Dr. Mark L. Hornick Wikipedia

  8. Example 2: Byte Input Streams SE-2811 8 Dr. Mark L. Hornick

  9. Ex 3: Bikes SE-2811 9 Dr. Mark L. Hornick

  10. Ex 4: Employees SE-2811 10 Dr. Mark L. Hornick http://zishanbilal.files.wordpress.com/2011/04/042811_2030_designpatte31.png

  11. Design Principles Reduce coupling Increase cohesion Encapsulate what varies Favor composition over inheritance Program to interfaces, not implementations Classes should be open for extension but closed for modification Which of these are met? SE-2811 11 Dr. Mark L. Hornick

  12. Downsides What are the disadvantages of decorators? SE-2811 12 Dr. Mark L. Hornick

  13. SE-2811 13 Dr. Mark L. Hornick

Related


More Related Content