Listening For and Raising Events in the BLL
Posted
by
OneSource
on Programmers
See other posts from Programmers
or by OneSource
Published on 2013-10-22T09:00:55Z
Indexed on
2013/10/22
10:13 UTC
Read the original article
Hit count: 230
I'm working on a WinForms .Net Recording App and I have a RecordingMgr in my BLL to listen for new events captured by another class. I want to display the events in my UI and I'm stuck as to what's the best way to do this. I can think of a few scenarios to handle this but all of them seem sub-optimal:
- Listen for and handle Recorded Events in both the UI and in the RecordingMgr
- After receiving the event in the RecordingMgr, raise it again so that the UI can pick it up
- Create a variable in RecordingMgr (e.g., a BindingList) that the UI can bind to and update it when an Event is received
- Ditch the RecordingMgr and just put the event recording logic in the UI
What's the best approach? Something above or something else?
© Programmers or respective owner