- A Create event handler classes and subscribe them to the appropriate delegates.
- B Use global variables to track the state of the business process and execute logic conditionally.
- C Implement a polling mechanism that checks for event conditions within the main process loop.
- D Embed the event response logic directly within the business process methods.
- Share this MCQ
Answer:
A
Explanation:
Correct: Create event handler classes and subscribe them to the appropriate delegates.
Option A is correct because event handler classes and delegates provide a decoupled way to respond to events. Option B is incorrect as global variables do not provide a mechanism for event handling and can lead to tightly coupled code. Option C is incorrect because embedding the logic within the methods leads to tight coupling and is not a best practice for event handling. Option D is incorrect as polling is not an efficient or recommended method for event handling in this context.
Related Topic: