文档介绍:Object-Oriented Software EngineeringPractical Software Development using UML and JavaChapter 6: Using Design Patterns? Lethbridge/Laganière 2001Chapter 6: Using design Introduction to PatternsThe recurring aspects of designs are called design patterns.?A pattern is the outline of a reusable solution to a general problem encountered in a particular context?Many of them have been systematically documented for all software developers to use?A good pattern should—Be as general as possible—Contain a solution that has been proven to effectively solve the problem in the indicated context. Studying patterns is an effective way to learn from the experience of others? Lethbridge/Laganière 2001Chapter 6: Using design patterns3Pattern descriptionContext: ?The general situation in which the pattern appliesProblem: —A short sentence or two raising the main : ?The issues or concerns to consider when solving the problemSolution: ?The mended way to solve the problem in the given context. —‘to balance the forces’Antipatterns: (Optional)? Solutions that are inferior or do not work in this context. Related patterns: (Optional) ?Patterns that are similar to this pattern. References:? Who developed or inspired the pattern.? Lethbridge/Laganière 2001Chapter 6: Using design The Abstraction-Occurrence Pattern?Context: —Often in a domain model you find a set of related objects (occurrences).—The members of such a set mon information-but also differ from each other in important ways.?Problem: —What is the best way to represent such sets of occurrences in a class diagram??Forces: —You want to represent the members of each set of occurrences without duplicating mon information? Lethbridge/Laganière 2001Chapter 6: Using design patterns5Abstraction-Occurrence ?Solution:TVSeriesseriesNameproducerEpisodenumbertitlestorySynopsis******?Occurrence??Abstraction?******TitlenameauthorLibraryItembarCodeNumber******isbnpublicationDatelibOfCo