You may bring one page of notes (possibly front and back, but only a single
sheet of paper) to the exam.
Review
- Remember, see exam 1 prep for things
like approach, making sure you answer questions, using technical
terminology
Topics
The exam will focus on material since exam 1, but may include some of the
older material.
Review Questions
- Explain how you could (usefully) apply the Adapter pattern to the
garden simulator lab.
- We presented cohesion and coupling as primary measures of modularity
for classes/modules/packages/methods. Are there other things that might
promote strong modularity in these?
- Some engineers argue for a type of coupling based on
inheritance. Identify reasons to list this as a different type of
coupling and reasons to not.
- Are all uses of Java's reflection features
(like
setAccessible
) content coupling?
- Why do you suppose the worst type of coupling is called "content"
coupling?
- What type of cohesion does a program exhibit if it has just one
large
Main
class? Explain.
- What is the difference between temporal cohesion and procedural
cohesion?
- Why do you suppose the highest form of cohesion termed "functional"?
- Explain how JavaFX implements MVC. Why might its implementation of
MVC be inadequate for large projects?
- Name 3 forms of excise found in IntelliJ.
- Many websites go to the extreme of having very few choices on their
landing page while others have an overwhelming number. Why are both forms
of excise?
- Name 3 types of excise experienced in the everyday life of students
(not involving software).
- Explain two uses of the Command pattern besides eliminating the
excise of "do you really mean to do that?" messages.
- Draw the command pattern as it might be applied to registering for
courses in the coming semester.
- Identify how the Decorator pattern could be applied to a classroom in
a software system, describe that system, and draw a diagram showing the
application. Which classes need to be abstract or interfaces?
- Give significant differences between the Strategy and Decorator
patterns (so that a programmer could decide which to use).
- Can you write a Java application that uses threads that is guaranteed
to never terminate?
- Do threads require multi-core CPUs? Explain.
- If a method is synchronized and two threads execute the method at the
same time, which goes first? Why?
- Explain what
Platform.RunAfter
does.