G
Guest
Hello,
I'm building up a new application framework that consists of multiple
components that communicate through events. These components publish their
events as they do work and consume events through what I'm calling the Event
Service Controller (ESC).
The purpose of the ESC is to receive events from the individual components
and then publish events through multicast to each component that has
subscribed to the events it is interested in. You might think of this as a
traffic control system in that all communication goes to the ESC and then it
is broadcast again.
All of these components, and the ESC use a set of interfaces that define
what events they publish.
The problem that I'm running into is that when the ESC starts a component,
how can it determine which interface(s) that component is using to publish
events? I have many different components that (obviously) do not need to know
anything about other components and I want all communication (through events)
to go through the ESC to facilitate an elegant design. For example, I might
later code a component to log specific events received by the ESC, regardless
of where they came from and whatnot.
The crux of the problem is that a specific component may raise only a few
events defined in its interface, of which the ESC has a reference to, but the
ESC has no way of knowing at runtime which interface(s) that component is
going to use and therefore I cannot figure out a way to bind the event
handlers in the ESC to the component.
Ideas? I appreciate any help you can provide... I know that I can use
reflection to get the publically exposed events from the components but that
still leaves me trying to figure out the logic to bind those events to the
corresponding handlers in the ESC.
Thanks in advance!
Chris
I'm building up a new application framework that consists of multiple
components that communicate through events. These components publish their
events as they do work and consume events through what I'm calling the Event
Service Controller (ESC).
The purpose of the ESC is to receive events from the individual components
and then publish events through multicast to each component that has
subscribed to the events it is interested in. You might think of this as a
traffic control system in that all communication goes to the ESC and then it
is broadcast again.
All of these components, and the ESC use a set of interfaces that define
what events they publish.
The problem that I'm running into is that when the ESC starts a component,
how can it determine which interface(s) that component is using to publish
events? I have many different components that (obviously) do not need to know
anything about other components and I want all communication (through events)
to go through the ESC to facilitate an elegant design. For example, I might
later code a component to log specific events received by the ESC, regardless
of where they came from and whatnot.
The crux of the problem is that a specific component may raise only a few
events defined in its interface, of which the ESC has a reference to, but the
ESC has no way of knowing at runtime which interface(s) that component is
going to use and therefore I cannot figure out a way to bind the event
handlers in the ESC to the component.
Ideas? I appreciate any help you can provide... I know that I can use
reflection to get the publically exposed events from the components but that
still leaves me trying to figure out the logic to bind those events to the
corresponding handlers in the ESC.
Thanks in advance!
Chris