![Create Robust Scalable Delphi Application With Event Bus Framework | Embarcadero RAD Studio Delphi C++Builder Blogs create robust scalable delphi application with event bus framework](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/01/Create-Robust-Scalable-Delphi-Application-With-Event-Bus-Framework-2979284.png?resize=1140%2C675&ssl=1)
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.
![DelphiEventBusArchitecture9988622 | Embarcadero RAD Studio Delphi C++Builder Blogs delphieventbusarchitecture 9988622](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/01/DelphiEventBusArchitecture-9988622.png?resize=750%2C445&ssl=1)
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); |
![embarcaderodelphieventbusframework2252711 | Embarcadero RAD Studio Delphi C++Builder Blogs embarcadero delphi event bus framework 2252711](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/01/embarcadero-delphi-event-bus-framework-2252711.jpg?resize=750%2C500&ssl=1)
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition