分布式计算原理与应用(Distributed_Computing)
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
2
Message Passing versus Distributed Objects
The message-passing paradigm is a natural model for distributed computing, in the sense that it mimics interhuman communications. It is an appropriate paradigm for network services where processes interact with each other through the exchanges of messages. However, the abstraction provided by this paradigm does not meet the needs of the complexity of sophisticated network applications.
2/24/Βιβλιοθήκη Baidu019 Distributed Computing, M. L. Liu 3
Message Passing versus Distributed Objects –2
Message passing requires the participating processes to be tightly-coupled: throughout their interaction, the processes must be in direct communication with each other. If communication is lost between the processes (due to failures in the communication link, in the systems, or in one of the processes), the collaboration fails. The message-passing paradigm is data-oriented. Each message contains data marshalled in a mutually agreed upon format, and is interpreted as a request or response according to the protocol. The receiving of each message triggers an action in the receiving process. It is inadequate for complex applications involving a large mix of requests and responses. In such an application, the task of interpreting the messages can become overwhelming.
the state or data of the entity: in Java, such data is contained in the instance variables of each object; the operations of the entity, through which the state of 2/24/2019 Distributed Computing, M. L. Liu 5 the entity can be accessed or updated.
object-oriented programming
To illustrate, consider objects of the DatagramMessage class in Figure 6f (in Chapter 6). Each object instantiated from this class contains three state data items: a message, the sender’s address, and the sender’s port number. In addition, each object contains three operations:
a method putVal, which allows the values of these data items to be modified, a getMessage method, which allows the current value of the message to be retrieved, and a getAddress method, which allows the sender’s address to be retrieved.
2/24/2019 Distributed Computing, M. L. Liu 4
The distributed object paradigm
The distributed object paradigm is a paradigm that provides abstractions beyond those of the message-passing model. As its name implies, the paradigm is based on objects that exist in a distributed system. In object-oriented programming, supported by an object-oriented programming language such as Java, objects are used to represent an entity significant to an application. Each object encapsulates:
Distributed Objects
M. L. Liu
2/24/2019
Distributed Computing, M. L. Liu
1
Message Passing vs. Distributed Objects
2/24/2019
Distributed Computing, M. L. Liu