Info and Review for CS494, Exam 2, Spring 05
Did you get copies of all the handouts and photocopied readings in class? See the list at the end!
Last updated Friday, May 6, 2 pm. Final version!
Info on Exam:
You may take the exam during the exam period meeting: Thursday, May 12, 10-noon. Meet in Olsson 001!
Or, you may do the exam as a take-home before that. Pick it up from me in my office during office hours as follows:
Pick up the exam from Prof. Horton at during these times. These are also office hours if you need help or have
questions.
- Friday, May 6. 4-5 pm.
- Saturday, May 7. May be possible after 1:30 pm -- email me if you'd like to get it then.
- Monday, May 9. 11-noon, 1-2 pm. (Other times by appointment. Email or call.)
- Tuesday, May 10. 10-2 pm. (Other times by appointment. Email or call.)
- Weds. May 11. 10-11:30 am. (Perhaps available after 3 pm. Email or call.)
Here are the things you need to know about the exam:
- You'll have two hours to take it. I'll design it as if it were for a 80-minute class, so this should be plenty
of time.
- It's only on material since the 1st exam. It's not comprehensive. Exception: all design patterns could be
covered; see below.
- It's closed book, closed notes, no computer access. Just you and a pencil.
If you have other questions, email me.
Review and topics:
UML:
- Implementing code that reflects a UML class diagram. (See slides On to Design and your copy of Chapter
7 of Ambler's book.)
- Association classes
- Basics of state diagrams
- Not on exam: collaboration diagrams
Architecture and Design:
From the slides On to Design and related readings. Main topics include:
- What's added to class diagrams created during analysis?
- Layered architecture example: 5-layer model
- Controller classes
- Note issues related to coupling and cohesion in this reading, and also in the Evaluating Class Diagrams
slides.
Refactoring:
- Fundamentals of refactoring: what is it? why do it?
- Code smells: examples
- Relation of refactoring with TDD, unit testing.
- What are kinds of refactoring supported by Eclipse?
Design Patterns:
Which ones? All of the ones we've studied! Singleton, Composite, State, Observer, Factory Method, Abstract Factory,
Decorator, Facade
- What's a static factory method? How is this related to a constructor?
- Explain the general structure of an Abstract Factory?
- Which of the above patterns use the concept of delegation? How? Explain.
- Which of the above patterns use an interface or abstract class as part of their solution? How do they use this?
What is the design rationale for using this?
Design Quality:
Topics include:
- Inheritance issues: What Coad says. Specializing along dimensions. Multiplicity, inheritance, composition.
Forms of coupling. Why define parameters as interface types?
- Other coupling issues: shy code and the Law of Demeter.
Questions:
- Give reasons why account information and customer information should not be combined in one class. What's a
better solution.
- Give examples of when inheritance is less desirable than composition.
- Say a system supports users, some of whom can take on special roles at times, such as ProjectDirector for a
given project. Is inheritance appropriate to model users and directors, or is there an alternative?
- Talk about Square, Rectangle, and the Liskov subsitutability princple.
- What does the ISP say about extracting interfaces from classes?
- Give some examples of using Dependency Inversion Princple in action? Does this somhow relate to package design
too?
Package Design:
- Give 3 reasons to group a set of classes in the same package.
- What does the Reuse Equivalency Princple say about the re-use or release of Java classes?
- In UML, what's the most important thing we model about relationships between packages? What is one rule about
such relationships?
- What are design princples related to the stablity and abstractness of packages in a system?
- What is a reasonable metric of measuring a package's abstractness?
- What are the basic ideas of other package
design principles?
List of Readings and Handouts:
- Law of Demeter. Photocopy from The Pragmatic Programmer.
- Principles of OOD. Chapter 6 from Bob Martin's book, UML for Java Programmers.
- Refactoring. Photocopy of Chapter 8 from Wampler's book.
- Object-oriented Design. Photocopy of Chapter 7 from Ambler's book, The Object Primer.