Assignment 3
Submit a PDF of up to 3 pages, on wattle
Amount of time you should take: ~4 hours (or 1 hour if you came to class last Thursday)
In this assignment you should identify the use of a Factory Pattern and Observer Pattern in the Crystal Game. You should then draw the class diagrams and interaction diagrams for the implementation of those two patterns within the crystal game.
Both of these design patterns are described in the Fox textbook. They are also extensively described on Wikipedia and other places on the web.
Assignment 2: Metrics and Design Assessment
Submit a PDF of up to 4 pages, on wattle
Amount of time you should take: ~4 hours.
Background information
In class we discussed the notions of cohesion, coupling, maintainability, and other measures of software quality. [Note here that "quality" is not the same as the architectural notion of "quality attribute" -- this quality refers to the quality of the code itself, not the qualities and non functional requirements of the system.]There are several flavors of cohesion (described somewhat here) :
- Coincidental
- Logical
- Temporal
- Procedural
- Communicational
- Sequential
- Functional
- No direct coupling
- Data coupling
- Stamp coupling
- Control coupling
- External coupling
- Common coupling
- Content coupling
TASK:
Assess your Crystal Game design (the UML class diagram, including associations derived either at the high level, or from sequence diagrams) against these qualities of Coupling and Cohesion, and comment on whether they are positive or negative for the design of your system.You may need to use additional sources (besides Wikipedia?!) to help you in your task. If you do, please cite the sources you use.
It is not strictly necessary to apply quantitative measures to assess cohesion and coupling, but if you wish to apply a formula to calculate the degrees of either of these measures, please indicate the formula you are using, and where you got it.
Partial Example
There are two kinds of coupling in this picture. One of these is shown explicitly with a link between the two coupled classes (A and B). That is "message coupling". Message coupling (from wikipedia) is a loose form of coupling: The interface between the two classes is clear, even if they use one another a lot. However, implicit in this picture is also external coupling. This means that the two classes both rely in the same data formats present in the data module. We could also argue that that relationship imposes Stamp coupling (or data-structured coupling), because both of the classes are using the same data structure (the Data module), and would be affected if it changed. One way to reduce the data coupling might be to wrap the data module in a class, and only use methods of that class to access the data. That way the stamp coupling would be reduced to method coupling.
Both of the classes are highly cohesive -- they both only do one thing, related to their primary function. A only does "a" related things, and B only does "b" related things. We can say that each of these classes is functionally cohesive.
Assignment 1
Due: September 17Amount of time you should take: ~3 hours
Reflect on your experience with the Crystal Game requirements, then:
In a 3 page report (11pt font, 1.5 space, normal margins, figures as needed) describe your experience of deriving the design from these requirements.
In particular, describe (if you noted any):
- ambiguities,
- incorrect requirements,
- missing requirements
- repeated requirements,
- ...
Provide examples of requirements you would change, and how you would remedy the problems above.
