Please enable JavaScript.
Coggle requires JavaScript to display documents.
CHAP 8: Implicit Asynchronous commnunication software architecture -…
CHAP 8:
Implicit Asynchronous commnunication software architecture
Implicit Asynchronous Communication
Can be specified in 2 different modes
non-Buffered
Buffered
Refer some architecture that apply the
publisher-subscriber patterns
producer-consumer patterns
the subscribers/consumers are interested in
events
messages issued by a publisher/producer
The message queue and message topic
are typical buffered asynchronous architectures
subscribers/consumers need to register their interests with
the event/message is fired off when available on the buffered message queue or topic
Message queue
a one-to-one or point-to-point architecture
between message senders and message receivers
Message topic
a one-to-many architecture
between publishers and subscribers
Non-Buffered Event-Based Implicit Invocations
Breaks the software system into 2 partitions
Event sources
Event listeners
The event registration process connects these two partitions
no buffer available between these two parties
The event source class must provide mechanisms to
Register / Deregister event targets
To notify event targets of the occurrence of the event
Event targets must specify the action in the handleEvent() method to respond to incoming events
Above the concrete classes are the interfaces for event source and event listener
Is a good solution for user interaction in a user interface application
Non-Buffered Event-Driven Architecture
Applicable Domain
Interactive GUI component communication
Integrated Development Environment (IDE) tools
Applications that require loose coupling between components
The implementation of state machines
When event handlings in the application are not predictable.
Benefits
Framework availability
Framework availability
System maintenance and evolution
Independency and flexible connectivity
Possibility of parallel execution of event handlings
Limitations
Difficult to test and debug the system
Hard to predict and verify responses
Hard to predict and verify the order of responses from the listeners
The event trigger cannot determine
When the response finished
The sequence of all responses.
Tight coupling between event sources and their listeners
More than in message queue based or message topic based implicit invocation
Data sharing and data passing in the event object forwarded from event sources to event listeners
Reliability and overhead of indirect invocations may be an issue
Buffered Message-Based Software Architecture
Breaks the software system into 3 partitions
Message producers
Message consumers
Message service providers
They are connected asynchronously by
a message queue
a message topic
also considered data-centric.
In a message-based system ( Fire & Forget system)
a sender
sends out a message
does not care much of the response from the receivers
except for guaranteed message delivery
Typically implemented as a Message-Oriented Middleware (MOM)
providing a reliable message service on a distributed system
Has been used for a long time
Messaging systems are used to build
reliable, scalable, and flexible distributed applications supporting asynchronous communication.
,
Is a peer-to-peer client-server architecture
The high degree of independency between components
Its high scalability, interoperability in heterogeneous networks, and reliability
Message
A structured data with a message id, message header, property, a body
Messaging
a mechanism or technology that handles asynchronous message or synchronous message to delivery effectively and reliably.
Message client can
Produce mesage
Send messages to other clients
Also consume messages from other clients
must register with a messaging destination (a specific queue)
Point-to-Point Messaging (P2P)
The message queue architecture
is a point-to-point structure between producer and consumer
Is composed of
Message queues
Senders
Receivers
sent to a destination which is maintained by the consumer
Consumer clients extract messages from these queues
The queue retains all messages they received
Until the messages are consumed
until the messages expire
Each message has only one consumer
A sender and a receiver of a message have no timing dependencies
Requires every message sent to the message queue must be processed successfully by a consumer
Publish-Subscribe Messaging (P&S)
Is a hub-like architecture
publisher clients send messages to
Message topic publishers and subscribers
Each topic message can have multiple consumers
Have a timing coupling dependency
A message topic consumer
must subscribe the topic
before it is published
unless subscription is a durable subscription
which is able to receive any topic messages
Message-Based Architecture
Applicable Domain
Where the communication between a producer and a receiver needs
Wants the components not to depend on information about other components' interfaces
Wants the application to run
The application business model allows a component to
Benefits
Providing high degree of anonymity
between message producer and consumer
Supporting for concurrency
among customers or producer and consumers
Providing scalability and reliability of message delivery
Supporting batch processing
Supporting loose coupling
Limitations
Capacity limit of message queue
Difficult to determine the numbers of agents
Complexity development
Increased complexity of the system design and implementation