Advanced Software Analysis and Design
Advanced Software Analysis and Design
Laboratory 9
Design Patterns
Fall 2017
LAB 9. Design Patterns
9.1 Goals
After watching the lectures and performing the exercises given below, the student should be able to:
1. Understand how to structure various applications using different architectural styles.
2. Understand where specific design patterns might be of use in an application.
3. Refactor an existing design to incoporate specific design patterns
9.2 Exercises
b) In the system described in a) above, there are several components that must be unique within
the system. These components include the Data Repository and system Configuration Manager. If
more than once instance of these components is created, system data integrity could be lost.
c) In this system, we would like to give various components the ability to be notified when certain
data changes within the Data Repository. However, to reduce network overhead, we do not want
the components checking for these changes. Instead, there needs to be an approach where the
component can register to be notified when specific changes occur.
d) The system itself will be composed over several components that provide a wide variety of
services. Other interface components will be required to interact with these various components
to get services. However, we would like to simplify the design of these interface components by
providing an easier way for the interface components to find and interact with the various system
components. In essence, we would like the interface components to only have to deal with one
relatively simple interface to access all the various components of the system.
2
9.2.3 Design Pattern Application
We are designing an editor that must manipulate a variety of entities. Due to the way the editor
manipulates these entities, it is critical that each entity be created with an identifier that is unique from
every other entity in the current editor project. Each entity also has unique characteristics that it must
possess as well. There are three types of entities: agents, roles, and goals. Use the Factory Method
Pattern to perform intermediate design of the entity creation part of the editor; include all entity and
factory classes and interfaces. Your design should include a class model and a sequence model. The
sequence model should show an example of all three concrete types of entities being created. You should
analyze your design in terms of the 5 design principles we have been using in this course.
9.3 Completion
You should turn in:
1. Answers to each item in Section 9.2.1 (one paragraph each).
2. Your justification and component model for the system described in Section 9.2.3.
3. Your class and sequence model for Section 9.2.3.