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:
- Event-Driven
- Thread Safe
- Designed to decouple different parts of your application
- Attributes based API
- Support different delivery mode
Sample source code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
1.Define events: IEvent = interface(IInterface) ['{3522E1C5-547F-4AB6-A799-5B3D3574D2FA}'] // additional information here end; 2.Prepare subscribers: Declare your subscribing method: [Subscribe] procedure OnEvent(AEvent: IAnyTypeOfEvent); begin // manage the event end; Register your subscriber: GlobalEventBus.RegisterSubscriberForEvents(Self); 3.Post events: GlobalEventBus.post(LEvent); |
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition