J
jehugaleahsa
Hello:
I was forced to write some EXTREMELY complex code to make binding to
custom business objects possible in WinForms. The reason for so much
code was to handle state management. For instance, we needed a way to
determine whether an record was added, updated, deleted, etc. so when
it came time to save we knew which type of SQL to execute.
The problem with binding is that it leaves no obvious place for
complex form validation. 99% of the time, validation is very simple.
However, that 1% is very problematic. In these rare cases, avoiding
binding seems like a better solution overall.
The problem is that without binding, the larger forms start to become
a hodge-podge of event handling and are very error prone. Originally,
the folks in my office were talking about making our WinForms
stateless, so they acted a lot like web pages (one action per click/
screen). However, the whole point of client/server applications is to
allow many changes before needing to hit the database again.
So, the question comes down to: how can we achieve a proper MVC in a
stateful environment that doesn't result in a large amount of manual
UI manipulation? We want to maintain a large level of control without
the complexities of managing the UI manually. It seems like binding is
what MS is expecting people to use. However, managing state using
binding and NOT using data tables seems to result in extremely complex
code.
I am hoping someone has a good article I can view. Any suggestions for
how to achieve a stateful UI without complex binding and event
handling would be greatly appreciated. The more generally applicable
the approach, the better.
Thanks,
Travis Parks
I was forced to write some EXTREMELY complex code to make binding to
custom business objects possible in WinForms. The reason for so much
code was to handle state management. For instance, we needed a way to
determine whether an record was added, updated, deleted, etc. so when
it came time to save we knew which type of SQL to execute.
The problem with binding is that it leaves no obvious place for
complex form validation. 99% of the time, validation is very simple.
However, that 1% is very problematic. In these rare cases, avoiding
binding seems like a better solution overall.
The problem is that without binding, the larger forms start to become
a hodge-podge of event handling and are very error prone. Originally,
the folks in my office were talking about making our WinForms
stateless, so they acted a lot like web pages (one action per click/
screen). However, the whole point of client/server applications is to
allow many changes before needing to hit the database again.
So, the question comes down to: how can we achieve a proper MVC in a
stateful environment that doesn't result in a large amount of manual
UI manipulation? We want to maintain a large level of control without
the complexities of managing the UI manually. It seems like binding is
what MS is expecting people to use. However, managing state using
binding and NOT using data tables seems to result in extremely complex
code.
I am hoping someone has a good article I can view. Any suggestions for
how to achieve a stateful UI without complex binding and event
handling would be greatly appreciated. The more generally applicable
the approach, the better.
Thanks,
Travis Parks