Download - Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2
![Page 1: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/1.jpg)
Today:
Distributed Objects and Components
1
![Page 2: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/2.jpg)
Me
Greg Paperin
MSci Computer Science
href=http://www.paperin.org
2
![Page 3: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/3.jpg)
Contents
• Centralised Systems Problems and issues
• Solution – Distributed Systems (DS)
• Properties of DS• Software for DS - Components• Distributed Components – Objects
Communication, Transparency, Interfaces
• Distributed Software Technology – Middleware Issues & Examples
3
![Page 4: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/4.jpg)
Centralised Systems’ Properties
• One physical device (all in one box) One physical location
• One or a few CPUs
• Shared memory, resources
• Shared busses / connections
• One-type architecture – non-heterogeneous.
4
![Page 5: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/5.jpg)
Centralised Systems’ Issues
• One physical location vulnerable against threads from outside
• Shared resources & busses single point of failure
• One or a few CPUs single point of control,pseudo-concurrency
• Non-heterogeneous can’t mix specialized CPUs
5
![Page 6: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/6.jpg)
Addressing problems of centralised systems (1)
• No real concurrency Multiple CPU help, but:
- resource allocation problems- connection (bus) allocation problems- control point problems (e.g. task allocation)
Solution: have own power supply, cache, memory, busses and other resources for each CPU
Result: many “small” separate systems
6
![Page 7: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/7.jpg)
Addressing problems of centralised systems (2)
• Many “small” separate systems is good, but:
- how can they work together ?
Interconnected by a network (preferably a non-centralized one)
7
![Page 8: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/8.jpg)
What we get from it
• No single point of failure• No single point of control• True concurrency• Resources not shared, but accessible• Can have a large number of CPUs• Subsystems / CPUs can be different – heterogeneity • Subsystems can be in different physical locations
A Distributed System 8
![Page 9: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/9.jpg)
Properties of Distributed Systems
• The components (subsystems) of a DS are autonomous• Processes run in true concurrency on diff. subsystems• A DS is heterogeneous • A DS is open• A DS is scalable• A DS is Fault tolerant• A DS must be secure• Transparency
9
![Page 10: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/10.jpg)
Transparency of Distributed Systems
•Access transparency
•Location transparency
•Concurrency transparency
•Replication transparency
•Failure transparency
•Migration transparency
•Performance & Scaling transparency 10
![Page 11: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/11.jpg)
Identifying Components
What chunks can be distributed ?
Single commands- Too small
Threads- No encapsulation
Encapsulation? It rings a bell!- Yes, we distribute objects !!!
11
![Page 12: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/12.jpg)
Components / Objects need to communicate
• Traditional approach –
Remote Procedure Call
• Object oriented elaboration is
Remote Method Invocation
12
![Page 13: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/13.jpg)
Interfaces
• Heterogeneous environment• Different programming languages
Objects required to publish an interface in a
portable manner. Interface Definition Language
13
![Page 14: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/14.jpg)
Binding
•Must be transparent
•Static vs. Dynamic
14
![Page 15: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/15.jpg)
Dynamic Binding
•Servers publish supported interfaces
•Broker acts as a catalogue
•Binder locates required server
•Can happen on first invocation or every time
15
![Page 16: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/16.jpg)
16
![Page 17: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/17.jpg)
Advantages of Dynamic Binding
• It is flexible• It can support multiple servers supporting the same interface aiding transparency by:
- Using version IDs- Spreading load evenly over the servers- Pooling the servers periodically and automatically deregistering “dead” servers- Aiding in authentication and security by only connecting authorised servers with authorised users 17
![Page 18: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/18.jpg)
Data passing
•Remote calls must be transparent•But:
- Client, Server or Network can crash- Client and Server run on two different processes
in two different address spaces on two different
architectures
18
![Page 19: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/19.jpg)
Issues with data passing
• Machines might use different encoding
• Unknown point of failure
19
![Page 20: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/20.jpg)
Solve encoding heterogeneity
Big endian Little endian 2’s complement 1’s complement
Marshalling / Unmarshalling
Calls by referenceReference flattening
20
![Page 21: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/21.jpg)
21
![Page 22: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/22.jpg)
Marshalling policy
• Canonical - Safe- Easy- Can be inefficient
• Informed- Everybody must know about all formats on the system- This might make scalability a difficult and expensive issue
22
![Page 23: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/23.jpg)
Reference Flattening
•Resolve all references
•Pass everything by value
•Update changed parameters on return
•Use call-back for large objects (e.g. sparse arrays)
23
![Page 24: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/24.jpg)
Reference Flattening example
24
FirstListItem=0x038B06
value = 82next = 0x110011
value = 11next = 0xE6C835
value = 19next = 0xNULL
FirstListItem = 0x2
value = 82next = 0x8
value = 11next = 0xD
value = 19next = NULL
![Page 25: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/25.jpg)
Execution semantics (1)
No reply. What’s happened?
? A network error occurred and the server never received the request
? Server started the processing of the request but “crashed” during the execution
? Server successfully processed but the reply got lost due to a network failure
25
![Page 26: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/26.jpg)
Execution Semantics (2)
What can we do:•Should requests and replies be confirmed ?•Should messages be retransmitted until a confirmation or timeout ?•Should servers memorise requests and reject duplicates ?•Should a history of replies be kept in order to retransmit them without re-executing operations ?
26
![Page 27: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/27.jpg)
Execution Semantics (3)
•Maybe call semantics
•At-least-once call semantics
•At-most-once call semantics
27
![Page 28: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/28.jpg)
Where does this all come from ?
Functionality must be transparent to programmer, i.e. automatic.• Generated by a compiler?
Too inflexible Middleware software system
Transparently handles:- RMI- Persistence- Security- etc.
28
![Page 29: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/29.jpg)
Multi-Tier Software
• Persistence layer
• Business logic layer
• User Interface layer
29
![Page 30: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/30.jpg)
The RMI part of middleware(deals with communication)
•Proxy-makes remote method invocation transparent to clients by behaving like a local object to the invoker.-forwards it in a message to a remote object-one each remote object
•Dispatcher-one for each class representing a remote object-receives the request message from the communication module
•Skeleton-implements the methods in the remote interface30
![Page 31: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/31.jpg)
The RMI part of middleware functionality
31
![Page 32: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/32.jpg)
Persistence in Middleware
•Persistent objects
•Persistent object store
•Persistent root
•Persistent interface
•Location service
•Objects run in “containers” monitoring object’s
states 32
![Page 33: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/33.jpg)
Examples
• Common Object Model (COM) by Microsoft- Windows based
• Common Object Request Broker Architecture (CORBA) by OMG
- General platform and language independent standard
• Enterprise Java Bean (EJB) by Sun- Specific to Java
33
![Page 34: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/34.jpg)
Summary
• Centralised vs. Distributed systems• Properties of DS • Identifying Distributed Components• Interfaces• Binding, Dynamic binding• Data passing
- Marshalling / Unmarshalling- Flattening
• Execution semantics• Multi-Tier Software Architecture• Services of Middleware
-RMI-Persistence
34
![Page 35: Today: Distributed Objects and Components 1. Me Greg Paperin MSci Computer Science href= 2](https://reader036.vdocuments.mx/reader036/viewer/2022062905/5a4d1ad97f8b9ab05997421d/html5/thumbnails/35.jpg)
References
[1] Wolfgang Emmerich:Lecture slides for Distributed Systems for Communication
(1998).[See http://www.cs.ucl.ac.uk/staff/W.Emmerich/lectures/DS98-99/]
[2] Tanenbaum and van Steen:Distributed Systems: Principles and Paradigms [See http://db.uwaterloo.ca/~tozsu/courses/cs454/notes/3.invocation.pdf]
[3] C.H. Kim:
Distributed Systems Lab, Chungnam National University[See http://flower.ce.cnu.ac.kr/~hchoi/class/AdDistSy/RMI.pdf]
[4] Badri R. Narayanan:
Distributed Objects and Remote Invocation[See http://www.cs.stevens-tech.edu/~badri/CS649/DSRemoteInvocation.pdf]
35