Architecture
Components
Structure of the library includes several components, such as:
Request
RequestMap
RequestHandler
Response
Event
EventMap
EventHandler
MessageBroker
EventEmitter
Container
Dispatcher
Middleware
MiddlewareChain
Mediator
Components Dependency
Request-related system side:
Event-related system side:
Components Interaction
Request dispatching:
Description:
- Client sends JoinMeetingCommand to Mediator.
- Mediator sends this command to Dispatcher.
- Dispatcher gets its handler and builds instance of command handler class via Container.
- Dispatcher handles command using certain method of its handler.
- Dispatcher returns DispatchResult to Mediator, which contains published events and Response.
Event dispatching:
Description:
- Dispatcher returns DispatchResult to Mediator, which contains published events and Response.
- Mediator sends published event to EventEmitter.
- Event gets its handler and builds instance of event handler class via Container.
- EventEmitter handles command using certain method of its handler.