Connecting Components (AIGR view)
A fundamental concept in CCastle is the connection between components; by Ports and Protocols. The implementation of a component can’t see ( or ‘reach’) anything outside it own Component. It can only react on data on an (incoming) Port, and sent data (like events) over an (outgoing) Port.
In this chapter we examine how that conceptually works and which data-structures in a AIGR are needed to capture it. For simplicity we limit ourselves to Events (and so EventProtocols & Eventhandlers) for now. Other kinds, like “Data”, “Stream” are added later.
Primary Classes
Let’s start with an overview of the dataclasses in the AIGR, that are fundamentally to connect components by communicating with events.
The
ComponentInterface&ComponentImplementationdescribe the Component. One with an external aspect, and one with the internal parts – the later are “hidden”.
Notice that both are named – and will have the same name.The external aspects of the
Portclass are “visible”; they are mentioned in the ComponentInterface. Aside of it’s name, its direction (like incoming) and type are also visible.
Here we assume its type is an (Event)Protocol. Then, thePortlinks to anEventProtocol; which is a specialization ofProtocol.The
EventProtocolcontains a list ofEvents. As events are sent from component to component, they are clearly “visible”.The
Eventhandlers however, are “hidden” and invisible outside the Component (Implementation).
They are triggered by the external event, and associated with aPort, and anEventwithin a specificProtocol[1].Note
As both
ComponentInterfaceandProtocolsupport sub-classing, one should ponder the inherited Ports & Events too – see the fieldsbased_on.
Footnotes
Comments
comments powered by Disqus