View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

CoWeb assignment - 3

Object-Oriented Language Design (1 point)
In this class, we introduced a variety of object-oriented languages (Smalltalk, C++, Objective-C, Java, C#, Ruby, Eiffel, CLOS) and their language features. For each of the parts below, explain how the two approaches differ. Then, from the languages mentioned above, give one example of each case.


Dynamic dispatch vs. static dispatch

Dynamic Dispatch = Late Binding
The process of mapping a message to code (method) at runtime
Examples: Smalltalk, Java, Objective-C, Ruby, Python

Static Dispatch = Early Binding
Examples: Eiffel, C++(except virtual functions).


Single dispatch vs. multiple dispatch

Single Dispatch = Message Passing
The code that gets called is based on the type (class) of the receiver object.
Examples: Smalltalk

Multiple Dispatch = Generic Functions
The code that gets called is based on the type of all objects.
Prioritizes the method, rather than the object.
Examples: Java, c++, c


Dynamic typing vs. static typing

Dynamic Typing

Static Typing

Garbage Collection (1 point)
Reference counting was one of the first implementations of garbage collection. Ultimately, it proved problematic. Why?


it can run in small chunks of time closely interwoven with the execution of the program. This characteristic makes it particularly suitable for real-time environments where the program can't be interrupted for very long. A cycle is two or more objects that refer to one another, which has a reference back to its parent.

Name two advantages and one disadvantage to using garbage collection.

Advantages
Disadvantages

Design Patterns (1 point)
Take one design pattern that we discussed in class and describe how it works. In your description, include a UML diagram of the pattern (these are fairly easy to find on the WWW).


Uploaded Image: BridgePatters.gif


The Abstraction defines the interface that the client uses for interaction with this abstraction. That is, the client makes requests directly to the Abstraction object, as that is the only interface known to the client. The Abstraction object also maintains a reference to an Implementer object. The collaboration between the objects in this pattern is such that the client requests are forwarded by the Abstraction to the Implementer through this reference. A Refined Abstraction, then, is simply any and all extensions to the Abstraction class. The Implementer defines the interface for any and all implementations of the Abstraction.

Link to this Page