Skip to main content
added 16 characters in body; added 17 characters in body; deleted 3 characters in body; edited body
Source Link
tanikaze
  • 59
  • 1
  • 4

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, if System A is interested in Event E from System B, you could give. You can pass System A an interface it can use to register a pointer to its function(or a delegate, or callback Interfacefunction, what have you)say EventHandler(Event e), with System B, or it could register a callback interface or a delegate or other similar concept. System B maintains a list of these interfaces/functions and calls them with the event as an argument when it wants to raise the event.

You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain. System B maintains a list of these interfaces/functions and calls them with the event as an argument when it wants to raise the event.

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, if System A is interested in Event E from System B, you could give System A an interface it can use to register a pointer to its function(or a delegate, or callback Interface, what have you) EventHandler(Event e) with System B. You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain. System B maintains a list of these interfaces/functions and calls them with the event as an argument when it wants to raise the event.

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, System A is interested in Event E from System B. You can pass System A an interface it can use to register a pointer to a function, say EventHandler(Event e), with System B, or it could register a callback interface or a delegate or other similar concept. System B maintains a list of these interfaces/functions and calls them with the event as an argument when it wants to raise the event.

You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain.

added 134 characters in body
Source Link
tanikaze
  • 59
  • 1
  • 4

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, if System A is interested in Event E from System B, you could give System A an interface it can use to register a pointer to its function(or a delegate, or callback Interface, what have you) EventHandler(Event e) with System B. You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain. System B maintains a list of these interfaces/functions and calls them with the event as an argument when it wants to raise the event.

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, if System A is interested in Event E from System B, you could give System A an interface it can use to register a pointer to its function(or a delegate, or callback Interface, what have you) EventHandler(Event e) with System B. You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain.

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, if System A is interested in Event E from System B, you could give System A an interface it can use to register a pointer to its function(or a delegate, or callback Interface, what have you) EventHandler(Event e) with System B. You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain. System B maintains a list of these interfaces/functions and calls them with the event as an argument when it wants to raise the event.

Source Link
tanikaze
  • 59
  • 1
  • 4

There's no one right answer for communication between different domains of any piece of software. In your case, it sounds like you want something like an "event" system. You should give your systems the ability to subscribe to events that other systems "raise" with information about the event. The Observer Pattern is a common pattern when implementing events.

For example, if System A is interested in Event E from System B, you could give System A an interface it can use to register a pointer to its function(or a delegate, or callback Interface, what have you) EventHandler(Event e) with System B. You can also use a "central dispatch" type class that stands in between these two if you think the extra layer of indirection makes your architecture easier to maintain.