Class Participation Exercise: Factory Method Pattern (Mar 29)
Class Participation Exercise: Factory Method Pattern
Design a framework using the Factory Method Pattern for:
- Application and Document superclasses
- And an actual application would make these:
- Add MyApplication and MyDocument subclasses
- Add YourApplication and YourDocument subclasses
Write a general newDocument method in Application that ultimately instantiates a MyDocument if your application is a MyApplication.
- Draw the UML class diagram for the above problem using the Factory Method Pattern using concrete and abstract classes.
- What is the code in MyApplication for the method newDocument?