Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Joys of Working with Distributed Component Systems Prof. Rushikesh K Joshi Department of Computer Science and Engineering Indian Institute of Technology,

Similar presentations


Presentation on theme: "The Joys of Working with Distributed Component Systems Prof. Rushikesh K Joshi Department of Computer Science and Engineering Indian Institute of Technology,"— Presentation transcript:

1 The Joys of Working with Distributed Component Systems Prof. Rushikesh K Joshi Department of Computer Science and Engineering Indian Institute of Technology, Bombay Rkj@cse.iitb.ac.in

2 What are we discussing today? Some facets of system design in the domain of component systems Our approach will be through scattered examples from standards to services to implementation of standards The link between them is that they form a part of the issues which are addressed by component systems in various layers

3 `What IS a Caucus-race?' said Alice; not that she wanted much to know, but the Dodo had paused as if it thought that SOMEBODY ought to speak, and no one else seemed inclined to say anything. `Why,' said the Dodo, `the best way to explain it is to do it.' (And, as you might like to try the thing yourself, some winter day, I will tell you how the Dodo managed it.) From Alice’s Adventures in Wonderland

4 “The best way to explain is to do it” Understanding by Doing

5 Refining our Understanding of a System Understanding and Implementations at user level are not enough to truly appreciate the architecture that makes it possible to express and execute high level ideas Try implementing small bits and fractional pieces of the system that you want to understand When I showed this slide to a student, he asked me whether it has something to do with prototyping. I am not talking of prototyping of your applications, it’s about understanding some design aspects of lower layers which form the basis of expression and execution of your applications.

6 But who is to give the prizes?' quite a chorus of voices asked. `Why, SHE, of course,' said the Dodo, pointing to Alice with one finger; and the whole party at once crowded round her, calling out in a confused way, `Prizes! Prizes!' Alice had no idea what to do, and in despair she put her hand in her pocket From Alice’s Adventures in Wonderland

7 “And the whole party at once crowded round her, calling out in a confused way, `Prizes! Prizes!' Distribution Vs. Centralization

8 Realizing a Framework for a Distributed Component System Components Component Framework Bus: A set of protocols How to implement them? Single vs. Coordinating Distributed Servers Load sharing and Fault tolerance

9 Coordinating Daemons M1 M2 M3 objects Orb daemon

10 Libraries and Daemon Processes object CORBA libraries A CORBA daemon CORBA libraries Another CORBA daemon Another CORBA Service A CORBA Service

11 "Twinkle, twinkle, little bat! How I wonder what you're at!" You know the song, perhaps?' `I've heard something like it,' said Alice. `It goes on, you know,' the Hatter continued, `in this way:-- "Up above the world you fly, Like a tea-tray in the sky. Twinkle, twinkle--"‘ From Alice’s Adventures in Wonderland

12 ‘How I Wonder What You are At!' Sending Messages to remote Objects, without having to know ‘where’ they go..

13 Client Observe the Location Transparency // This is a client //... main () { Library * iitb_lib ; //... iitb_lib = Library :: bind (“IITB_LIB”); Book b = iitb_lib->list_a_book (“OOP”) }

14 Designing Surrogate/Proxy Objects ClientProg Account deposit () AccountProxy deposit () remoteAcc->deposit RealAccount deposit () remoteAcc

15 The General Proxy Pattern Client subject operation () Proxy operation() realSubj->operation RealSubject operation () realSubj

16 Design Aspects to Note about the Proxy Both real and proxy objects confirm to an abstract superclass Thus, they both implement the same interface However, their implementations are different A client can handle a remote object through the proxy as if it’s available locally. Internally, the proxy object carries out the communication with the remote object An IDL compiler generates the require proxy code and helper functions

17 `How doth the little crocodile Improve his shining tail, And pour the waters of the Nile On every golden scale! `How cheerfully he seems to grin, How neatly spread his claws, And welcome little fishes in With gently smiling jaws!‘ From Alice’s Adventures in Wonderland

18 ‘ How neatly spread his claws, And welcome little fishes in With gently smiling jaws!’ Receiving and ‘Digesting’ Message to Objects held inside a Server

19 An Example Server //…. Class Library_Skeleton { ….}; // generated for you Class Library_Impl : public Library_Skeleton {…}; main ( ) { Library *lib ; lib = new Library; orb->object_is_ready (lib); orb->implementation_is_ready (lib); }

20 Designing a service loop and dispatcher Service loop: While true receiveAMessagePacket identify the object dispatch the messagePacket to the object return the returned result And In the object: decode the packet call local method return results

21 Found WHAT?' said the Duck. `Found IT,' the Mouse replied rather crossly: `of course you know what "it" means.' `I know what "it" means well enough, when I find a thing,' said the Duck: `it's generally a frog or a worm. The question is, what did the archbishop find?' From Alice’s Adventures in Wonderland

22 “I know what ‘it’ means enough when I find a thing ” Designing Generic Services

23 The basis: Generalization A Specialization Generalization Yet Another Specialization Another Specialization

24 An Example of a Generic Service Send in Take out narrow Implemented by

25 Then you should say what you mean,' the March Hare went on. `I do,' Alice hastily replied; `at least--at least I mean what I say- -that's the same thing, you know.' `Not the same thing a bit!' said the Hatter. `You might just as well say that "I see what I eat" is the same thing as "I eat what I see"!' `You might just as well say,' added the March Hare, `that "I like what I get" is the same thing as "I get what I like"!' `You might just as well say,' added the Dormouse, who seemed to be talking in his sleep, `that "I breathe when I sleep" is the same thing as "I sleep when I breathe"!' `It IS the same thing with you,' said the Hatter, and here the conversation dropped, and the party sat silent for a minute From Alice’s Adventures in Wonderland

26 ‘I say what I mean’ ‘I mean what I say’ Applying Contracts in Design and Implementation

27 Applying Contracts Syntactic Behavioral (e.g. Meyer’s Design by contract) –Preconditions –Postconditions –Invariants Orthogonal contracts

28 Syntactic Contracts Interfaces –JAVA interfaces –C++ Pure Abstract Classes –CORBA IDLs –COM interfaces which are closed for modification Typically captures set of messages in terms of member function names, parameters, their types and their directions, blocking/non-blocking type

29 Mayer’s Design by Contract TM Preconditions to be ensured by client Postcondition to be satisfied by supplier What are the benefits? Class invariants An Example in Eiffel

30 Further Readings OMG’s CORBA standard Programmer’s manual for MICO Eric Gamma et al.’s book on Design Patterns Design Patterns in CORBA, try to inspect the code generated by IDL compiler OMG’s CORBA Naming Service Specification Bertrand Mayer’s book on Object Oriented Software Construction And of course..Lewis Carroll’s Alice’s Adventures in Wonderland


Download ppt "The Joys of Working with Distributed Component Systems Prof. Rushikesh K Joshi Department of Computer Science and Engineering Indian Institute of Technology,"

Similar presentations


Ads by Google