lecture6_2up - Object-Oriented Software Engineering...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 6: Using Design Patterns Lecture 6 January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 290 DESIGN PATTERNS The Gang-of-Four: Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides Design Patterns: Elements of Reusable Object Oriented Software (1995). 294 Pattern description Context : • The general situation in which the pattern applies Problem : —A short sentence or two raising the main difFculty. 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. January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 310 Factory Method : The Problem January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 310 Factory Method : The Problem 1. Frameworks use abstract classes to define and maintain relationships between objects January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 310 Factory Method : The Problem 1. Frameworks use abstract classes to define and maintain relationships between objects 2. Consider a framework for applications that present multiple documents to the user. A drawing application is an example. January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 310 Factory Method : The Problem 1. Frameworks use abstract classes to define and maintain relationships between objects 2. Consider a framework for applications that present multiple documents to the user. A drawing application is an example. 3. This framework defines two abstract classes: application and document. These ought to be sub classed by clients for application specific implementation. January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 310 Factory Method : The Problem 1. Frameworks use abstract classes to define and maintain relationships between objects 2. Consider a framework for applications that present multiple documents to the user. A drawing application is an example. 3. This framework defines two abstract classes: application and document. These ought to be sub classed by clients for application specific implementation. 4. The application class will create and manage documents when required, e.g. when a New command is selected from the menu. January 02, 2009 O b j e c t O r i e n t e d S o f t w a r e E n g i n e e r i n g 311 Factory Method Pattern: The Problem 5. Document sub class is application specific . Hence the Application class does not know what kind of document to create!...
View Full Document

This note was uploaded on 02/23/2012 for the course CS 307 taught by Professor Staff during the Summer '08 term at Purdue University.

Page1 / 95

lecture6_2up - Object-Oriented Software Engineering...

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

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