tags:

views:

104

answers:

2

For along time, I've been using event-driven programming for all my windows application. i.e. handle a selected index changed / Text changed etc.. events. but lately I've been using the INotifyPropertyChanged interface and ObservableCollection class to handle data changes.
Do you see any possible problems that I could face by using this method in the long run as the application / properties involved grows?

+5  A: 

Data driven and event driven paradigms are not necessarily mutually exclusive. Even when you're using MVVM-style modes there is still a UI that is driven by the user and you therefore have to consider events. But using ideas like MVC and now MVVM concepts you decouple a lot of your logic from the UI which should lead to better maintainability, testability etc. Better/greater decoupling will lead to fewer problems as the app grows rather than more. So, IMO, you're on the right track.

Requisite Wikipedia article. It's an interesting read though you won't see INotify... and ObservableColl... mentioned because those are technology-specific. There's also an interesting criticism section you might want to check out. But don't let that one section outweigh the other considerations.

Paul Sasik
+1  A: 

They're the same thing, except that the source and direction are different.

As you're describing it:

  • event-driven allows you to update the data based on user interaction
  • data-driven allows you to update the user based on changes in the data

Consider that INotifyPropertyChanged forces the implementation of the PropertyChanged event. They're the same, and can work well together.

SnOrfus
Two sides of the same coin.
WernerCD