1/18
Learn about MOM
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
what is MOM
decouple the request that’s being made from the component that resolves that request. this way, we structure around the messages and not the components
direct approach
button maintains a list of objects to call when pressed, a listener pattern is used to observe the press and actuate the appropriate method
general approach
build an interface where there is no direct relationship between interface and action
benefits of general approach 1
more specialised components which can be changed without affecting others. interface components to handle user interaction and action components to affect the database
benefits of general approach 2
dynamically add new components
decoupling
effect is not closely coupled with cause - events are sensed and reflected in the system and components react to those events
drawback of general approach 1
the behavior of the system comes from its composition
drawback of general approach 2
increased complexity but also increased flexibility
viewpoint of how components operate 1
object, component or service oriented - focus on the bits that do the work or hold the state
viewpoint of how components operate 2
event or message oriented - focus on the interactions between the components
event
packet of data saying “this just happened”, e.g., mouse click, transaction
what does an event carry
event type, timestamp, source, payload
design decision 1
set of event types - static, dynamic, extensible
design decision 2
payload - what, constrained, free form
how does a component produce an event
create the data structure and submit it to the middleware
asynchrony in event systems 1
producer and handler do not synchronise
asynchrony in event systems 2
client knows neither the identity nor number of components who will consume the event
asynchrony in event systems 3
client doesn’t know whether event has been consumed, and if so whether it was successful or not
asynchrony in event systems 4
client may not know that one event is processed before another