CST 276 – Final
Wilsonville, Fall 2016
This is a take home final. You must turn in your final on Blackboard by mid-night on Wednesday, 7 December 2016. You may use any and all resources available to you to complete this final. Turn in your own work. Do not copy/paste from a source (for example from the internet), instead read the source, understand the material and then put your answer into your own words.
Section 1 – Terminology and Concepts (50 points)
Answer each question in this section with enough detail that the instructor understands that you understand the term or concept.
- (6 points) Contrast the following terms:
- Class vs. Interface
- Composition vs. Inheritance
- Design vs Programming
- (5 points) What are “design patterns”? Describe what they are, where they come from and how they are used.
- (8 points) What is meant by the following design principle and why is it important? Name a pattern that is based on this principle and explain how. “Encapsulate what varies”.
- (5 points) Why does the Observer pattern use an interface for the Observer object? What benefit does this bring to a design? What design problem does it solve?
- (5 points) Explain the similarities and difference between Factory Method and Abstract Factory patterns.
- (5 points) Explain how the Command pattern enables “undo” functionality in an application. Use an example in your explanation.
- (5 points) Explain the similarities and differences between Adapter and Façade patterns.
- (5 points) What is a “Hook”? How does the Template Method pattern make use of hooks? Given an example.
- (6 points) Name three patterns that MVC includes. Describe how these work together to accomplish the goals of the MVC pattern.
Section 2 – Understanding Patterns (20 points)
For each of the questions in this section, examine the given class diagram, identify any patterns used explain why or why-not the pattern is a good choice.
- (10 points) GUI form control input validation…
- (10 points) An industrial robot that assembles furniture…
Section 3 – Applying Patterns (30 points)
Read the problem statement and then draw and describe an object oriented design. Use pattern names in your description and explain why you chose those patterns.
- (30 points) Design a home alarm system. The system needs to include a control pad, sirens and plug-and-play remote sensors for doors/windows and motion. It should be possible to add new types of sensors in the future, for example smoke sensors. The system should have the ability to…
- “add” or “remove” a sensor
- “arm” and “disarm” by entering codes
- “alarm” when armed and a sensor is triggered, showing triggered sensor
- “remote monitor” by a monitoring station