Eric Musgrave ericm@jhu.edu Object Oriented Systems Assignment 4 600.321/421, Object Oriented Systems Assignment 4: Short Easy Written Problems on Later Lecture Due: December 16th 1) In your own words, describe one of the design patterns discussed in class and state why it qualifies as a pattern (refer to the definition of pattern for this) -A pattern is a problem that occurs over and over again, and a solution to that problem. One design pattern discussed in class was the Airline reservation system. It qualifies as a design pattern since the problem of reserving seats on a flight occurs over and over again, and the solution to that problem is the reservation system itself. 2) Define what reification means in an object-oriented programming context and give an example where reification may be useful (you can be vague about the details of the example). -Reification means to turn something that you would normally not think of as an object into an object. An example would be a Search, where the search is the object. 3) When defining a semaphore to be used for mutual exclusion, the semaphore is created and theSemaphore signal is sent to put one signal on the semaphore. Why? -So that the code the semaphore is blocking can be accessed (once) initially. If its initialized to 0, the code will not be able to be accessed, whereas if its more than 1 than more than one process will be able to access the code which violates mutual exclusion. 4) What are the possible states a processes running in VisualWorks can be in? -Running -Runnable -Suspended -Waiting 5) When an exception is raised, an object of what class is created that represents the exceptional event? -The "Exception" class or a subclass that more specifically describes the exception. 6) In what class is the system default new method to be found? Why? -The new method is defined in class Behavior. So, that is why all class objects respond to the new message. 7) Why is a hashing operation required to perform every message send in Smalltalk? -Because Smalltalk uses a method dictionary (IdentityDictionary), which associates method name keys to executable code block values. So when you call a function, Smalltalk has to hash on the function name to get the code block. 8) What is a tombstone in a copying (a.k.a. Baker) garbage collector? -A forwarding pointer to the new location of the object, that has been copied to the newspace. 9) Whats the difference between a distributed object-oriented system and an object-oriented database? -A distributed object-oriented system is a system where objects communicate with each other over network nodes. An object-oriented database includes implicit persistent objects plus an object- oriented data server.