When creating a robust and large-scale application containing lots of components interacting with each other, the Delphi Event Bus framework can be a great solution to maintain loose coupling and building a consistent platform.
If you know Bus Topology from Networking classes back in your Computer Science classes, you can easily understand what is Event Bus framework, because they are quite similar to each other. Event Bus encourages a publish-subscribe pattern in your systems.
Delphi Event Bus framework has lots of features & functionalities:
- Thread Safe
- Designed to decouple different parts of your application
- Attributes based API
- Support different delivery mode
Sample source code:
IEvent = interface(IInterface)
// additional information here
Declare your subscribing method:
procedure OnEvent(AEvent: IAnyTypeOfEvent);
// manage the event
Register your subscriber: