160 likes | 183 Views
II. Middleware for Distributed Systems. Outline Principles of Object-Oriented Middleware CORBA, COM and Java/RMI Resolving Heterogeneity Dynamic Object Requests. CORBA, COM and Java/RMI. Outline CORBA COM Java/RMI. Object Management Architecture. Vertical domain-specific interfaces.
E N D
II. Middleware for Distributed Systems • Outline • Principles of Object-Oriented Middleware • CORBA, COM and Java/RMI • Resolving Heterogeneity • Dynamic Object Requests CORBA, COM & Java/RMI
CORBA, COM and Java/RMI • Outline • CORBA • COM • Java/RMI CORBA, COM & Java/RMI
Object Management Architecture Verticaldomain-specific interfaces Non-standardizedapplication-specific interfaces Horizontalfacility interfaces Domain Interfaces Application Interfaces CORBA facilities Object Request Broker CORBA services General service interfaces CORBA, COM & Java/RMI
Object Management Architecture • CORBA Services • foundational services for use by developers of implementation objects • some published services: • Naming • Events • Transactions • Security • Trading • Common Facilities • object services provide functionality for use by objects, CORBA facilities provide standards for services used by applications • generic functionality needed by many applications (e.g., printing, document management, email, etc.) • Domain Interfaces • provide domain-specific objects for vertical application domains • Examples: Finance, Healthcare, Manufacturing, Telecom, Electronic Commerce, Transportation CORBA, COM & Java/RMI
Overview of CORBA Objects • CORBA objects differ from typical programming language objects: • CORBA objects can be located anywhere on a network. • CORBA objects (like Java objects) can run on any platform. • CORBA objects can be written in any of several languages. • CORBA object references are persistent. • CORBA object developers need know nothing of where their clients will be, what hardware or OS they will run on, or what language they will be written in. • CORBA objects approach universal accessibility. CORBA, COM & Java/RMI
Overview of CORBA Objects • A client of an object has access to an object reference for the object, and invokes operations on the object. • A client knows only the logical structure of the object according to its interface and experiences the behavior of the object through invocations. • Client code has no knowledge of the implementation of the object or which ORB is used to access the implementation. • An object implementation provides the semantics of the object, usually by defining data for the object instance and code for the object's methods. CORBA, COM & Java/RMI
Overview of CORBA Object Types • CORBA object model is statically typed • Object types have a unique name • Modules are used to provide scope • Nested modules • Object types are defined in IDL by interface • Interface contains operation, attribute, typeand exception • Atomictype: boolean, char, short, long, float, string • Complex types can be constructed from objects and atomic types • Instance of complex types are complex values that do not have identity and cannot be referenced CORBA, COM & Java/RMI
OMG IDL • OMG Interface Definition Language (IDL): • mappings for many languages/compilers; • independent of any particular language/compiler; • multiple-inheritance, public interface-structured specification language; • not for implementation. • primary support for interoperability between static and dynamic requests mechanisms. • IDL Structure • Module • a namespace • Interface • abstract type • multiple inheritance • Struct • structured data Module auction { exception NotAllowed {}; struct Sale { int price; string item; }; interface Auction { void bid (in long price) raises NotAllowed; }; } CORBA, COM & Java/RMI
C C++ ORB Ada Role of OMG IDL Object Implementation Side Client Side COBOL C I D L I D L I D L I D L COBOL Ada I D L I D L ORB I D L Internet InterORB Protocol (IIOP) I D L Small talk I D L I D L I D L I D L Small talk C++ C++ JAVA JAVA CORBA, COM & Java/RMI
Overview of CORBA Object Attributes • Attributes make state information of server objects accessible to client objects • Attributes are treated as a pair of operations (get and set) • All attributes that are declared in the interface are accessible to clients • Read-only attributes • Constants • Read-only for client objects • Read-only for server objects • Scoping rules • Define, then use • Forward declarations interface Player; typedef sequence<Player> PlayerList interface Trainer; typedef sequence<Trainer> TrainerList; interface Team { readonly attribute string name; attribute TrainerList coached_by; attribute Club belongs_to; attribute PlayerList players; … }; (**** there is a mistake here ****) CORBA, COM & Java/RMI
Overview of CORBA Object Operations • CORBA operations specify the services that clients can request from server objects • Operation name • Return type • List of parameters • In • Out • Inout • List of exceptions • Accessible to client objects (no private, or protected operations) • No overloading interface Team { … string print(); void bookGoalies(in Date d)…; … }; CORBA, COM & Java/RMI
CORBA CORBA, COM & Java/RMI
A Request • A request consists of: • Target object (target object identified by a unique object reference) • Operation • Parameters (the input, output and in-out parameters defined for the operation; may be specified individually or as a list) • Optional request context • Results (the result values returned by the operation) Client Object Implementation Client Proxy (stub code) Skeleton code Request ORB CORBA, COM & Java/RMI
Failure Handling • Exceptions are used to inform client object about their request failures • About 25 system failures • User defined exceptions exception PlayerBooked{}; interface Team { … void bookGoalies(in Date d) raises (PlayerBooked); … }; CORBA, COM & Java/RMI
Subtypes and Multiple Inheritance • CORBA object model support (multiple) inheritance • Public inheritance (inherit all) • Virtual inheritance (operations are dynamically bound) • Object is the root object • Conflict resolved at IDL compile time interface Organization{ readonly attribute string name; } interface Club: Organization { exception NotInClub(); attribute TeamList teams; readonly attribute short noOfMembers; void transfer (in Player p) raises (NotInClub); }; CORBA, COM & Java/RMI
Polymorphism • CORBA object model support restricted form of polymorphism • Inheritance relationship • Redefinition only on operations, not on attributes CORBA, COM & Java/RMI