My exams tend to have three to six questions. They are closed book, closed notes. I prefer to ask questions with objective answers. Mainly, I will ask you to draw diagrams and write Java code (although no GUIs). You will have the entire class period to finish the exam. The exam will emphasize the material covered since the last exam. The exam questions are mostly based on the homework and the lecture notes.
There are three levels of understanding. From lowest to highest they are:
Level 1: Able to understand explanations of others
Level 2: Able to solve new problems
Level 3: Able to explain material to others
You need to attain level 2 in order to pass the exam. This means you have read and understood your notes, reviewed your homework, and reviewed previous exams (level 1).
Beyond that, you have invented and solved variations of the problems discussed in class. (Level 2).
To attain Level 3, form a study group and take turns explaining the material to each other. If someone in the group gives a lazy or bad explanation, let him have it!
I tend to give away a lot of information in the review
session.
The final exam will be based on the lectures and the project. More specifically, you should be familiar with the following topics:
Modeling systems using UML Use Case, Class, Sequence, and Activity diagrams.
Designing systems using design patterns and UML class diagrams.
Testing systems using a testing framework like JUnit.
Refactoring, testing, anti-patterns, and test-driven development
Iterative cost estimation
Draw an activity diagram for the following systems:
The US Senate and the US House of Representatives follow similar procedures for making new laws. In the house a member introduces a proposed law, which is called a bill. The clerk assigns a number to the bill. The printing office makes copies of the bill. The Speaker of the House refers the bill to a committee. The committee can kill the bill by ignoring it or they can vote on it. If it passes, the bill goes to the Floor for a vote. If it passes it goes to the Senate for a vote. If it passes, it goes to the President. If the president signs it, it becomes a law. If the president vetoes the law, it goes back to the Senate and the House where a 2/3 majority is needed to override the veto. If the president does nothing, then the bill becomes law after 10 days unless congress is not in session. In this case the bill dies. This is called a pocket veto.
Draw UML Class diagrams modeling the following domains:
1. Plays are performed in a theater. There are two types of plays: tragedies and comedies. A play has many roles. Roles are played by actors.
2.
class A { ... }
class B { ... }
class C extends A {
B[] bees = new B[4];
}
3. There are two types of agents: diplomats and translators. An agent can send a message to another agent. In addition, translators can translate messages while diplomats can create messages.
Using the class diagrams above, translate the following scenarios into object diagrams, then translate into a Java main() method:
1. Macbeth, a tragedy, is being performed at the Globe Theater. The role of Duncan will be played by Jim Carey.
2. A Chinese diplomat sends a message, m, to a translator t1, who translates it into French and sends it to translator t2. This translator translates m from French to English and sends it to an American diplomat. Draw a sequence diagram assuming synchronous message passing
Be able to write use case elaborations as discussed in class. In particular, know what a scenario is and the relationship between use cases and scenarios.
Assume a system consists of three use cases. Assume each use case specifies a sequence of actions to perform:
uc1 = abaabbaaabbb
uc2 = abaabbccdddd
uc3 = aabb
Draw a use case diagram showing the relationships between these use cases.
Draw use case diagrams for the following systems:
1. An account management system (eg. Quicken)
2. Email clients (e.g., pine, elm, mail, Netscape Inbox, Eudora, Outlook) allow users to log onto and off of SMTP, POP, and IMAP servers. Users may download email messages from their POP or IMAP servers. The downloaded messages are stored in a local mailbox. Messages can be moved to other mailboxes. (For example, Eudora mailboxes include In, Out, and Trash. Of course users can create other mailboxes.
A user can search a local mailbox in various ways (search subject, body, and from). A user can sort a mailbox in various ways (by date, sender, subject). A user can select a message from the local mailbox. A user can display, forward, reply to (/all), print, save, or delete a selected message. Additionally, a user can compose a new email message. The new message is sent by uploading it to the user's SMTP server.
Email clients also maintain an address book containing email addresses of regular correspondents. Users can add or delete addresses from the address book. Users can search the address book in various ways.
3. A web browser (eg. IE or Netscape)
4. Virtual Parlor (VP) is a chat room. Anyone with a VP client program can connect to a VP server program and begin chatting with other participants. A participant may ask to see the recent contributions of the other participants, or the participant may contribute a message to the chat room.
5. An appointment organizer.
6. A watch.
You should be familiar with the patterns listed at:
http://www.mathcs.sjsu.edu/faculty/pearce/cs160/patterns2/DesignPatterns.htm
Be especially familiar with the patterns discussed in class, and even more familiar with the patterns used in the project.
1. A spread sheet consists of a grid of cells:
Cell[][] sheet = new Cell[M][N];
Each cell has a value that's updated by an update method. The update method may refer to the values of other cells in the sheet to compute its value. A cells update method can be called by the user. It is also called automatically each time any of the cells it depends on are updated.
Of course the spread sheet needs a user interface, too. Typically, the UI consists of a variety of controllers that process user input (menus, toolbars, dialogs) and a variety of views that display the spreadsheet (worksheet view, bar graph view, pie chart view, etc.)
How would you design and implement the Cell class using the Publisher-Subscriber Pattern?
2. A popular computer game allows a player to navigate the game's hero through a series of places in an alien world. In each place the hero encounters various aliens. An alien may be friendly toward the hero, hostile, or duplicitous (seems friendly but is actually hostile). Worse, an alien may actually change his strategy for interacting with the hero in mid-game!
The places the hero travels through all offer basic services:
interface Place {
void enter(Hero h); // what happens
when the hero enters a place
void display();
void add(Alien a);
void exit(Hero h);
}
A basic implementation if this interface is provided:
class EmptyPlace implements Place {
List aliens = new LinkedList();
void enter(Hero h) {
// h may now move about this place
}
void add(Alien a) { aliens.add(a); }
void display() {
// display an empty room
}
void exit(Hero h) {
// h exits
}
}
Of course different places may want to add different behavior to each of these methods.
Draw a UML class diagram modeling the alien world. Consider using the strategy pattern for aliens and the decorator pattern for places.
After a student has been admitted to Northern California University, a student record is created in a database. This record holds the student's name, identification number, major, and grade point average. It also holds a list of all semesters the student attended. For each semester, there is a list of courses the student took. Each course has a department, number, title, number of units, and of course the grade the student received. Faculty and administrators may view and update student records. A student may view his own record.
Draw a domain model using a class diagram.
Draw a use case diagram.
How would you design STS? Consider using the following patterns: Three-Tier architecture, Model-View-Controller, Proxy, DAO, and Transfer Objects.
Implement a student record in Java.