DesignPatterns

DesignPatterns - Object-Oriented Software Engineering...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 2 6.1 Introduction to Patterns The 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
Background image of page 2
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 3 Pattern description Context : The general situation in which the pattern applies Problem : A short sentence or two raising the main difficulty. Forces : The issues or concerns to consider when solving the problem Solution : The recommended 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.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 4 6.2 The Abstraction-Occurrence Pattern Context : Often in a domain model you find a set of related objects ( occurrences) . The members of such a set share common 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 the common information
Background image of page 4
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 5 Abstraction-Occurrence Solution: TVSeries seriesName producer Episode number title storySynopsis * «Occurrence» «Abstraction» * Title name author LibraryItem barCodeNumber * isbn publicationDate libOfCongress
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 6 Abstraction-Occurrence Antipatterns: name author LibraryItem barCodeNumber isbn publicationDate libOfCongress Title name author LibraryItem barCodeNumber isbn publicationDate libOfCongress name author LibraryItem barCodeNumber isbn publicationDate libOfCongress GulliversTravels MobyDick
Background image of page 6
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 7 Abstraction-Occurrence Square variant ScheduledTrain number SpecificTrain date * * * ScheduledLeg SpecificLeg actualDepTime * actualArrTime scheduledDepTime scheduledArrTime Station origin destination * *
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
© Lethbridge/Laganière 2001 Chapter 6: Using design patterns 8 6.3 The General Hierarchy Pattern Context : Objects in a hierarchy can have one or more objects above them (superiors), - and one or more objects below them (subordinates).
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/22/2011 for the course CS 101 taught by Professor Dat during the Spring '11 term at Bilkent University.

Page1 / 42

DesignPatterns - Object-Oriented Software Engineering...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online