SE 2811 Midterm Exam Prep
Closed-book, closed-note, and using Canvas.
Review
Bring your textbook to the review!
These are sample questions; some may be on the exam, but the exam question
is likely to be worded differently and there will be questions on other
material as well. Use these to make
sure you are familiar with each of the topics, to get practice thinking
about the sorts of questions you will see, and to make sure you know
the technical terminology.
General approach:
- know material, terminology; be ready to apply it
- ensure you are telling me all that's relevant
- be cautious of using the terms in the question in your answer
(especially for definitions!)
- think in terms of answering in sentences
- If a question asks for a reason, you might ask your self "why?" a couple
times to make sure you really do give a reason or otherwise go beyond
what's written in the question itself.
Topics
The exam will cover all of the material since the beginning of the
term. Ask if you are not quite sure what material that includes! Some key
things to know:
- Rational for studying design patterns and how they are communicated.
- How to apply the noun identification method to construct domain class
diagrams.
- The RIBS criteria and applying it to identify non-domain classes.
- Types of cohesion and coupling.
- UML notation, especially for class diagrams; practice drawing the
notation!
- Design patterns, including
- names, indicators, advantages of using, disadvantages
- constructing class and sequence diagrams showing the application of
a design pattern to a problem
- writing code illustrating applying the pattern
Don't try to memorize diagrams and code; you will remember just pieces of
it and fail to apply key concepts. Understand how the pattern works and
you can apply it in new domains.
- When to use an abstract class and when to use an interface (in Java).
- General design principles such as don't repeat yourself.
- Structural vs. behavioral vs. creational patterns.
- Other technical terms discussed in lecture and the textbook(s).
This is
not a comprehensive list. But these items tend to
show up on quizzes and exams, so provide a solid starting point. Do read
the textbook: it gives important context that helps you remember key
concepts and explanations.
Review Questions
- What are advantages of object-oriented designs over non-OO designs
(that is, procedural designs: collections of steps)?
- What would you tell a student in Data Structures to encourage them to
prioritize domain classes in their designs?
- Give three or more examples of classes that would appear in the solution
space but not the problem space.
- What are the goals of the noun (and verb) identification method for
systems design?
- For each of the RIBS criteria (state, behavior, identity,
responsibilities), think of a real-world object or concept that exhibits
fails to exhibit that criteria but which does exhibit at least one other.
- Consider a registration system: what would be good responsibilities for
- Class, Section, Schedule, Room,
Student, Instructor, Professor
- Draw a class diagram showing the relationships between these (and
any other obvious classes).
- How would advisors be handled in this system?
- Suppose a design includes a class called Main that captures
the main in a program along with other stuff. Explain how this
class violates the RIBS criteria in multiple ways.
- Explain how a high-level class diagram (covering just domain classes)
is useful in system design.
- Explain one or more ways in which a high-level sequence diagram can
be useful to the design process.
- How would you describe the design pattern for a classroom? What would
be the features? What would be reasons to not apply this pattern?
- Explain how the Null Object pattern shows up in JavaFX and draw a class
diagram illustrating it. Discuss any negative consequences for using the
Null Object pattern, applying those negatives to JavaFX programming.
- What type of pattern is the Null Object pattern, behavioral, creational,
or structural?
- When should you use the Singleton Pattern? Why is global access
important?
- The Adapter pattern was initially described as allowing a team to
replace one library by another. Give two other reasons to use the pattern.
- Explain how you would apply the Adapter pattern to the garden
simulator lab.
- Give significant differences between the Strategy and Decorator
patterns (so that a programmer could decide which to use).
- What would be a good reason to use both the Decorator and Singleton
patterns on the same class (at the same time)? If you think it's
unlikely, explain why.
- [See the sample questions slide from
the cohesion &
coupling notes.]