CSE132 Review for the Final Exam

Date and Time: The CSE132 final exam will be held on Tuesday, May 6 from 6:00 to 8:00pm in Lab Sciences 250. The exam covers material from the entire course, and counts as 50% of the exam portion of your course grade.

What to bring: Bring several sharpened pencils. You may also bring with you a single two-sided sheet of paper (8.5 by 11 inches), on which you may write any summary notes for your use during the exam. Note that if you bring such a page of notes, you will be required to turn it in with the exam.

Format: The exam will be divided into two parts, as described below. For an example of the basic exam format, see the Spring 2007 CSE132 Final Exam. Since the exam is primarily about design, solutions vary widely. Feel free to ask questions about possible solutions during office hours.

Part I: Application Design and Implementation (70 points)

You will be given a brief specification of a desired application program. Each subsection will be concerned with the design and/or implementation of a particular aspect of the application. In answering the questions, you may be asked to write code fragments, draw diagrams, list advantages and disadvantages of design approches, discuss an idea in a brief essay, etc. The sections are as follows.

Data Model (20 points)
Based on the given specification, you will need to decide how to represent the information that must be managed by the program. You will provide a class hierarchy for your design. You may be asked to explain your reasoning in choosing the desgin, and how your design will take advantage of inheritance and polymorphism. Be prepared to consider the use of abstract classes and interfaces in your design.

View (20 points)
You will provide a diagram for the user interface of the application, and identify the particular graphics components you would choose for the design. You will need to explain how the graphics components will represent the information contained in the model. This section concerns only the display of information, not handling user input. You may need to write some code for a view component corresponding to a particular model component.

Controllers (20 points)
You will describe the gestures through which users will interact with your application, and explain how they will be supported by your implementation. This section covers view updates in response to model changes (e.g., property change events), as well as model changes in response to user action (e.g., controllers that handle mouse events). Be sure you are comfortable with the model/view/controller paradigm, as well as the publish/subscribe Java event model. You may be asked to write code for one or more controllers.

Interprocess Communication (10 points)
In this section, you will be asked questions about how you would extend your application to support interaction between two or more connected users. You will need to consider how communication will be established, what kinds of messages will be sent, and how they will be handled when received. The use of synchronization for concurrency control, perhaps within a multithreaded server, may also arise.

Part II: Design Decisions (30 points)

This semester, you had the experience of designing and implementing a medium-sized application. Along the way, you made some mistakes, had to make changes, and sometimes experienced the painful process of realizing that you needed to redesign an entire subsystem. This is a normal part of the design experience. However, to learn from this experience, it is important to reflect on a design after the fact to think about the (good and bad) design decisions that were made along the way, and how they influenced the rest of the design, the implementation process, and the final product. You should have been keeping a design notebook all semester to help you review the design process you went through. It is strongly recommended that you page through your design notebook with your partner, going down memory lane to refresh your thoughts as you prepare for this part of the exam.

In Part II of the final exam, you will be asked to describe two design changes that you made during the semester, and to explain (briefly!) their impact. The format will be similar to the design decision forms that you used during the semester to record your decisions. For each design change, you will be asked to:

  1. State the design problem you were facing.
  2. Describe the old design and the new alternative(s) you considered when making the change.
  3. Explain what the problems were with the old design.
  4. Explain how the new design fixed those problems.

In addition, you will be asked to describe (in a similar fashion) a design change that you did not make, but that you wish you would have made if you had thought about it. Explain how that change would have made things better or easier.

Be careful to use correct design terminology, use diagrams correctly (in the case of class hierarchy design), and make proper mention of appropriate design patterns, where it is clear from the discussion that you really understand what you are talking about. Do not ramble. Saying a lot of stuff with the hope that you hit on the "right" thing is not going to work here, because any nonsense will count against your exam score. Your aim is to demonstrate a sophisticated understanding of design principles and techniques, along with proper use of the related design vocabulary.


How to prepare:

For Part I, review all of the design principles and ideas discussed throughout the semester. Minimally, make sure that you understand the relevant vocabulary so that you will understand the questions being asked on the exam. Beyond that, collect your thoughts by developing your own mental framework for the course. For each section of the course, think about how (and when) to apply each of the design principles, design patterns, and techniques. It is not necessary to memorize Java APIs. In any code you write, we will be forgiving if you don't use exact method names or class names from the Java API, as long as it is clear from context which class or method was intended. However, you should use correct terminology for technical ideas, such as design principles and patterns.

Review your notes, supporting readings, the code examples from class, and your own designs and implementations as needed to solidify your understanding of the following topics from the course. Obviously, there won't be time to ask about all of this on the exam, but you should be prepared just in case.

  1. Abstraction and Specification, including encapsulation, representation invariants, and abstraction functions, and related testing principles (such as the repOK method), documentation (including requires, modifies, and effects)
  2. Class hierarchy design and polymorphism, including relevant design patterns and UML notation, and the use of Java generics to support polymorphic data structures
  3. Orthogonality in design, such as is supported by the Comparator interface for Java collections
  4. Exception handling, including the semantics of try, catch, and finally
  5. The design patterns discussed in class on April 24.
  6. Streams, including the java.io framework in which streams wrap other streams to provide orthogonal features
  7. Iterators and the visitor patern, particularly in relation to their use with the composite pattern, as well as concurrent modification
  8. User Interface Design principles, especially the model/view/controller architecture, component nesting, making user interfaces that are clean, natural, consistent, and that provide direct manipulation of application-specific objects
  9. Standard simple GUI components in swing (JFrame, JPanel, JButton, JTextField, JLabel, etc.) and simple layout managers (BorderLayout, FlowLayout, GridLayout).
  10. The Java Event Model, including the EventQueue and common listener interfaces (ActionListener, MouseListener, MouseMotionListener, PropertyChangeListener), and PropertyChangeSupport. You are not expected to memorize APIs, but you should be familiar with the things that we've used a lot.
  11. Inner classes (static nested class, member class, local class, and anonymous class), including the ability to read and write inner classes that implement listener interfaces to serve as controllers
  12. Principles of model/view separation and how this is realized in the swing architecture
  13. Threads and concurrency control, including thread synchronization using join, wait and notify, locks, what "synchronized" and "volatile" mean, the resource allocation graph, and deadlock
  14. Data abstractions in support of concurrency, such as blocking queues
  15. Interprocess communication, including the basic ideas of IP and the TCP protocol, distributed applications that communicate by message passing, sockets (including Java's ServerSocket and Socket), handling concurrent clients that connect to a server, active and reactive message handling, remote method invocation (Java RMI), and how designing distributed algorithms presents additional challenges since there may be failures and there is no centralized global knowledge of the state of the system

For Part II, go back through your design notebook and make note of the most important design decisions you made along the way. Since you won't know in advance which aspects of the project I will ask about, be prepared to discuss at least one design decision from each of the lab assignments, as well as a decision for each assignment that you wish you had made (but didn't) in each lab. Remember that these are design decisions only, not strategic decisions (like which option you picked in lab 3) and not contractual decisions (like who implemented what). Reviewing the history of your design decisions with your lab partner may be helpful.

As you prepare, remember that you can bring with you to the exam a single 8.5x11 sheet of paper, with writing on both sides.

I will be holding my usual office hours until the day of the final.