COSC 4319 Distributed Object Computing

University of Houston

Fall 2000 Midterm 1 October 16, 2000

Name                                                                                       Student Number:

________________________________________________________________________

1.       Explain in less than 100 words what the following statement means: “C++ provides source level encapsulation and not object/binary level encapsulation” [5 pts]

 

 

 

 

 

 

 

 

2.       What problems do technologies like COM and CORBA solve? [5 pts]

 

(a)        _________________________  (b) _________________________

 

(c)        _________________________  (d) _________________________

 

(e)        _________________________  (f) _________________________

 

3.       Given the following partial client code, draw a diagram showing the sequence of events that occur under the hood between the time client requests for an object's interface and the time it gets it. For this discussion, assume there are no errors and client gets a valid pointer to the interface. Mention names of functions called where appropriate [10 pts]

        IPerson* pPerson;

        CoCreateInstance(CLSID_Person, NULL, CLSCTX_INPROC_SERVER,

IID_Person, (void**) &pPerson);

               

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4.       What is the purpose of generating a type library? [5 pts]

 

 

 

 

5.        “You can get to an interface from any supported interface, if you can get to it from some supported interface.” Why should you follow this rule? [5 pts]

 

 

 

 

 

 

 

 

6.       A COM class has prog ID “Systems.TV”. Write client code to (a) get an object of this COM class, (b) call increaseVolume(void) function on its ISound interface, and increaseBrightness(void) on its IPicture interface. Check errors. [5 pts]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

7.       Mention the names of five ATL classes and state their purpose [5 pts]:

 

(a) __________________       __________________________________________

 

(b) __________________       __________________________________________

 

(c) __________________       __________________________________________

 

(d) __________________       __________________________________________

 

(e) __________________       __________________________________________