The Sample Essay Exam


The Sample Essay Exam

In this section, you take a sample essay exam. Relax, it is the easiest part of the certification. It took me far less time than the exam allotted, even though I wrote complete answers. Complete answers don't necessarily have to be lengthy answers, however. My RMI versus sockets answer had eight parts , but another answer had only one crisp paragraph.

This exam doesn't intend to test your knowledge as the other certification exams do. Rather, this one simply attempts to make sure you did your own work. The evaluator compares the certification project you uploaded (which could have been completed by you or your guru friend) to the essay answers you provided (which are definitely your own work). If the evaluator finds no discrepancies, all is well. If he or she does, your final score will reflect these discrepancies.

The essay exam is an opportunity to make a good impression . After all, if the evaluators see sterling answers on your essay exam, they will assess your certification project favorably. If you ramble on about unrelated issues (for example, "Can you email me about?") or simply write poorly, you won't get the benefit of your evaluator's doubt for those subject areas. If your answers are written well, the evaluator is more likely to think you know your stuff and will push your grade up accordingly . Be aware that grammar, syntax, and spelling matter, if only in the evaluator's subconscious . Presentation counts, just as in fine cooking: Haute cuisine never tastes right on a paper plate.

The following guidelines will help you provide convincing answers:

  • Take time to understand the question before writing the answer.

  • Provide at least one paragraph for each question.

  • Each paragraph must contain only one main idea.

  • Do not use wordy, long sentences; write crisp statements.

  • Paragraphs should follow one another logically.

  • Check your spelling, grammar, and syntax before submission.

graphics/note_icon.gif

The essay exam is designed to ensure that you are the author of the certification project. If your answers to the essay exam are not consistent with the project you submitted, your project will be suspected of fraud.


There are only five questions on the exam. Three are technical (for example, "Did you choose RMI over sockets, and why?"), and two simply test whether you did your own work on the certification project (for example, "How did you implement the search feature in the GUI?"). The following 13 questions cover all aspects of the assignment that might be on the exam.

graphics/alert_icon.gif

You must provide answers on the essay exam that are consistent with what you wrote in your design choices document. The key to doing well on the essay exam is to provide a condensed version of the design choices document.


Exam Prep Questions

The following questions cover the most likely topics for your essay exam. The wording of the question isn't critical, but your familiarity with the topic is.

Question 1

Describe your record-searching approach.

Question 2

Describe your record-locking approach.

Question 3

Describe how your certification project handles exceptions.

Question 4

Describe whether you extended or modified the supplied classes, and include a justification of that choice.

Question 5

Describe what you did with deprecated methods in the supplied classes.

Question 6

Describe how you used design patterns.

Question 7

Describe your choice between RMI and sockets, and include a justification of that choice.

Question 8

Describe your network server and how you used it in your solution.

Question 9

Describe how you designed the GUI, especially the JTable component.

Question 10

Describe how your GUI handles events.

Question 11

Describe how your GUI communicates with the database.

Question 12

Describe how your design uses multithreading.

Question 13

Describe how your design addresses future modifications.

Answers to the Exam Prep Questions

In this section, you review the answers to the sample essay exam. The order of the questions is not important, and the answers are subjective . There are several ways to approach the answers, so the sample answers presented here are helpful, but not the only way to describe portions of your solution.

Keep in mind that the essay exam has two goals: making sure you did your own work (does it match the design choices document?) and you know what you are doing. (For example, make sure the evaluator wouldn't ask "Why is this candidate using the MVC pattern on a simple task like a search algorithm?) Remember that these answers are another chance to influence the evaluator in your favor. If you don't write these answers out ahead of time, you risk forgetting essential parts and giving incomplete answersones that might be mostly correct, but not impressive.

The answer format illustrated in the following exam answers helps convince the evaluator that you know what you are doing. Using a similar format also helps you remember the material so that you can write it out when you are in the exam roomwithout your design choices document.

graphics/tip_icon.gif

Keep your answers short and factual. Do not wax eloquent about your love of the MVC design pattern. Just give direct answers. That way, the evaluators can get on with their business and award you a great score.


Question 1

For the record-searching approach, the search method is abstracted so that it will search any table. It returns an array of rows in which each row has at least one value matching one value in the search criteria, using the following algorithm:

  1. Parse the criteria string with the StringTokenizer class.

  2. Get a new row of data from the database.

  3. Find a column that matches the criteria field name .

  4. Test for a match between the row value and the criteria value.

  5. If there is a match, save the row of data and go to step 2.

  6. If there is no match for the current criteria, go to the next criteria and then go to step 3.

  7. When the criteria are exhausted, go to step 2.

  8. When the rows are exhausted, return matched rows.

Question 2

The record-locking approach implements a separate LockManager class. A row is locked and unlocked by only one client at a time. The adapter for Database , DatabaseRemote , has a one-to-one relationship with a single client, so the client ID is the reference to DatabaseRemote . In the LockManager class, the client ID is referred to with a WeakReference . That way, should another client try to lock a record previously locked by a client who has died, the LockManager class removes the lock because the garbage collector will have nullified that reference. The responsibility for record locking is kept in the LockManager class, and the responsibility for references to dead objects stays with the JVM, a clean separation of responsibilities. A separate LockManager class is justified for the following reasons:

  • Allows Insert Row Locking (IRL), which handles multiuser-simultaneous record modification.

  • Provides consistent and concurrent access to data in a multiuser environment.

  • Allows the client to ignore IRL in local mode.

  • Without a good lock manager, users could overwrite each other's seat reservations .

Question 3

Exceptions are handled through proper try-catch-finally constructs and strong user -informing status messages. Users are kept informed of any problems with the use of clear status updates, such as the one displayed when they type in an impossible seat number.

Question 4

The supplied classes are not modified in any way. New classes subclass the original classes for the following reasons:

  • To maintain legacy compatibility for the original classes

  • To isolate new functionality

  • To cleanly separate changes to the old classes

  • To use a new name that is more descriptive of the class responsibilities

  • To override deprecated methods in the supplied classes

Question 5

The deprecated methods in the supplied classes are overridden with methods in a subclass that uses the latest SDK API.

Question 6

The following design patterns are used:

  • MVC : The Model component is SuperBowlTableModel , the View component is the Swing GUI, and the Controller component consists of event methods and JTable-triggered code.

  • Business Delegate : Remote interface through RMI.

  • Value Objects : Database record sent to the GUI.

  • Connection Factory : Factory class returns the local or remote database based on parameters. Client knows nothing about this.

  • Data Access Objects : Database class.

  • Decorator : DatabaseRemote decorates Database .

Question 7

RMI is used instead of sockets for the following reasons:

  • Thread safety is built into RMI, but you have to handle multithreading manually in sockets.

  • RMI has a Remote Method Protocol (RMP) communication protocol, but sockets don't.

  • RMI presents a simpler programming model than sockets do.

  • RMI supports dynamic class loading.

  • Method calls are type-safe in RMI.

  • RMI is built on sockets and is more mature.

  • It is easy to add new objects with RMI.

  • RMI is a known standard, so it is easy to share code with other developers.

  • The Registry acts as a central lookup for finding various remote objects.

Question 8

The network server is a combination of a database system using a binary file and RMI. The project uses RMI to listen to users. It is RMI that transforms a single-user file manager class into a multiuser database server since it handles multi-user issues such as multithreading. Also, RMI allows the database to be on a separate JVM from the client which represents a remote database service.

Question 9

The user interface is designed for ease of use, following good Human/Computer Interaction (HCI) principles. Several aspects of the GUI merit explanation. For example, the user can make a reservation in three simple moves: select a seat from the table, type in the number of seats, and click the Reserve button. The search feature is easy to use, with drop-down combo boxes filled with predefined criteria. Only Swing components are used in the GUI. The key components are a JTable, menu bars, buttons , combo boxes, labels, and tool tips. The GUI has a user-friendly look and feel. Additionally, the user can sort the entire table by clicking on any column heading. GUI components are arranged by using the BorderLayout component. These components are automatically repositioned proportionately when the window resizes. Altogether, the components' arrangement and interaction are designed to facilitate easy navigation, according to good HCI principles.

Question 10

The GUI handles events via the event model of MVC. User actions trigger event handler method invocation in the Controller component (logic code in the GUI), where a response is generated (for example, a seat is reserved).

Question 11

The GUI communicates with the database in two modes, local and remote. A separate DatabaseFactory class returns the local or remote database, based on parameters. The client does not have any lines of code specific to local or remote modes.

Question 12

This design uses multithreading, which comes with RMI. Also, the LockManager class has synchronized lock and unlock methods, so they are thread safe. Finally, public methods of the Database class are synchronized, which allows multithreading in a multiuser environment.

Question 13

This design addresses future modifications by using an architecture mixed with preexisting parts that already lend themselves to modifications and new robust parts. They include RMI (easy-to-add objects), an abstract search algorithm (works with new tables), a separate LockManager class (works on any record on any table in any database), a single interface that defines database methods (whether in local or remote mode), and the use of SDK classes (such as StringTokenizer ) instead of custom ones whenever possible.



JavaT 2 Developer Exam CramT 2 (Exam CX-310-252A and CX-310-027)
JavaT 2 Developer Exam CramT 2 (Exam CX-310-252A and CX-310-027)
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 187

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net