1 / 20

Chapter 21 Design Patterns Reviewed from the New Perspective of Object-Oriented Design

Chapter 21 Design Patterns Reviewed from the New Perspective of Object-Oriented Design. Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University. Outline. A Summary of Object-Oriented Principles

bfrank
Download Presentation

Chapter 21 Design Patterns Reviewed from the New Perspective of Object-Oriented Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 21Design Patterns Reviewedfrom the New Perspective of Object-Oriented Design Ku-Yaw Chang canseco@mail.dyu.edu.tw Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University

  2. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  3. A Summary ofObject-Oriented Principles • Objects are things with well-defined responsibilities. • Objects are responsible for themselves. • Encapsulation means any kind of hiding • Data hiding • Class hiding • Implementation hiding • Abstract out variations in behavior and data with commonality/variability analysis. • Design to interfaces. Design Patterns Reviewed

  4. A Summary ofObject-Oriented Principles • Think of inheritance as a method of conceptualizing variation, not for making special cases of existing objects. • Keep variations in a class decoupled from other variations in the class. • Strive for loose coupling. • Strive for high cohesion. • Be absolutely meticulous in applying the once and only once rule Design Patterns Reviewed

  5. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  6. How Design PatternsEncapsulate Implementations • Most patterns described by GoF • Give ways to hide specific implementations • Allow for easily adding new implementations Design Patterns Reviewed

  7. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  8. Commonality/Variability Analysis and Design Patterns • An example • Draw a square with drawing program one • Draw a circle with drawing program two • Draw a rectangle with drawing program one • Tow commonalities • Drawing programs • Shapes to draw • Patterns • Provide the backdrop in analysis and design • Give a common vocabulary for discussion • Incorporate best-practice approaches into your code Design Patterns Reviewed

  9. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  10. Decomposing a Problem Domain into Responsibilities • In the Bridge pattern • Problem domain composed of two different types of entities • Abstractions • Implementations • Decompose the problem domain • Objects • Which objects are needed • Responsibilities • How these objects are instantiated Design Patterns Reviewed

  11. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  12. Relationships Within a Pattern • Alexander • At this final stage, the patterns are no longer important. • Shalloway • The patterns have taught your to be receptive to what is real. • Relationships and forces described by the patterns • It is not the patterns themselves that are important Design Patterns Reviewed

  13. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  14. Patterns and Contextual Design • Patterns are microcosmic examples of contextual design • Designing to an interface is designing within a context Design Patterns Reviewed

  15. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  16. Field Notes • What implementations does this pattern hide? • Allow for changing them • What commonalities are present in this pattern? • Identify them • What are the responsibilities of the objects in this pattern? • Easier to do my decomposition by responsibility Design Patterns Reviewed

  17. Field Notes • What are the relationships between these objects? • More information about the forces • How may the pattern itself be a microcosmic example of designing by context • A better understanding of why the pattern is good design Design Patterns Reviewed

  18. Outline • A Summary of Object-Oriented Principles • How Design Patterns Encapsulate Implementations • Commonality/Variability Analysis and Design Patterns • Decomposing a Problem Domain into Responsibilities • Relationships Within a Pattern • Patterns and Contextual Design • Field Notes • Summary Design Patterns Reviewed

  19. Summary • Look at patterns by seeing • What they encapsulate • How they use commonality/variability analysis • How they decompose a problem domain into responsibilities • How they specify relationships between objects • How they illustrate contextual design Design Patterns Reviewed

  20. The End

More Related