DOC PREVIEW
UMD CMSC 433 - Practice Final Questions

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

433 Practice Final Questions - COM, JavaBeans, Design PatternsThe final exam is cumulative, covering topics from the entire semester.These questions mainly cover topics since the 2nd midterm. Look at the two midterms and their practice exams forquestions on topics covered earlier in the course.1. In C++, COM and Java, compare howit is determined that objects are no longer in use and their resources can berecycled. How can a programmer specify actions to be taken when an object is recycled? Try to find somethingnice to say about all three.2. Compare, briefly, the relative advantages of using RMI or sockets for a distributed computation.3. For the function Ticket register(Person p), the following are possible pre and post conditions (t isused to refer to the return value).(a) Pre: p is not already registered,Post: p is registered and t is a Ticket for p(b) Pre: p is not already registered,Post: (returns normally, p is registered and t is a Ticket for p)or (throws SoldOutException) Exception)(c) Pre: true,Post: (returns normally, p is registered and t is a FirstClassTicket for p)or (throws AlreadyRegisteredException)Ticket for p) AlreadyRegisteredException)SoldOutEx-ception)(d) Pre: Event not sold out,Post: (returns normally, p is registered and t is a Ticket for p)or (throws AlreadyRegisteredException)Assume that fareturns to f with pre and post conditions given in a, etc. Note that FirstClassTicket is a subtypeof Ticket, and that AlreadyRegisteredException and SoldOutException do not have a subtype relationship.• Show a table that describes whether or not it is legal to substitute a function with the described pre/postconditions for each of the other functions. In other words, which pairs of pre/post conditions could repre-sent legal relationships between a client function’s expectations/requirements and the function’s interfacecontract? (The same pairs should also represent legal relationships between the interface contract andimplementation guarantees made by the function provider)4. (short answers - no more than 3 sentences)(a) What is the QueryInterface function, and how does it typically work?(b) What are the security implications of declaring that a Java class implements Serializable?(c) How is Leasing used in distributed systems, and why is it useful?(d) Give an example where the Singleton design pattern would be useful.5. Write a JavaBean that implements a Rectangle interface, with properties of the following types:• Color color;• Point upperLeft;• Point bottomRight;• boolean visible;where Point has interface:1interface Point {int getX();int getY();void setX(int);void setY(int);}Include functions that allow other Beans to register as listeners on bound properties, and make the color andvisible properties bound so that they trigger events in listeners.6. Fill in code where indicated so that the visitAll method properly applies the visitor v to all nodes in the set s.Note that the additional code should not use instanceof, casts or reflection.interface Visitor {visitA(A a); // This method should be called on all A nodesvisitB(B b); // This method should be called on all B nodes}abstract Class Node {static void visitAll(Set s, Visitor v) {for(Iterator i = s.iterator(); i.hasNext(); ) {Node n = (Node) i.next();// fill in here}}// fill in here}Class A extends Node {// fill in here}Class B extends Node {// fill in


View Full Document

UMD CMSC 433 - Practice Final Questions

Documents in this Course
Trace 1

Trace 1

62 pages

Reflection

Reflection

137 pages

Testing

Testing

25 pages

Paradigms

Paradigms

10 pages

Testing

Testing

17 pages

Java RMI

Java RMI

17 pages

Java RMI

Java RMI

17 pages

Java RMI

Java RMI

17 pages

Trace 1

Trace 1

46 pages

Jini

Jini

4 pages

Final

Final

15 pages

Java RMI

Java RMI

13 pages

Testing

Testing

16 pages

Load more
Download Practice Final Questions
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Practice Final Questions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Practice Final Questions 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?