Events and the “Handled” pattern
When thinking about writing code for extensibility, the first answer is: use events!The use of events is a proven and established programming concept that can ease application upgrade and limit or even eliminate the need for code modifications in customized applications because of application platform changes.You can use events to design the application to react to specific actions or behaviour that occur. Events enable you to separate customized functionality from the application business logic.Events in AL language can be:
- Business events
- Integration events
- Internal events (subscribed only within the same module)
- Global events (predefined system events)
- Trigger events
There are three major participants involved in events: the event, a publisher, and a subscriber.An event is the declaration of the occurrence or change in the application. An event is declared by an AL method, which is referred to as an event publisher function. An event...