I have read online about MVC, MVP patterns for UI design. But, I can't quite grasp how the it works even after re-reading it couple of times. I use C#/winforms for development. Can someone point me to a good book/blog/website? Something that will make me decide if I should adopt it or not. Thanks.
Check out some of these videos over at PolymorphicPodcast. He does a good job of describing the MV* patterns and gives solid examples of each. Specifically, check out the winforms video.
I actually think Wikipedia's page on MVC has a very good overview of the Model View Controller architecture.
You can do MVC with Windows Forms and C#, but it is more difficult than with other platforms. MVC is all about separation of concerns - and should be usable with any platform. However, certain platforms make this much easier than others.
The "trick" to getting this to work well in a Windows Forms application is making sure to have a clear separation of concerns in how you design your forms. Try to keep some separation between the event handling (controller), the form design and layout (view), and the business logic and design (model). The basic design of windows forms doesn't explicitly force or guide you to having this separation, so it will just be up to you to keep those things separate.
The trickiest one in Windows forms is keeping the view and controller from getting too interdependent. The WinForm designer naturally puts all of the event handling into the same class as the form, so it's easy to get the two things tied together. You'll have to keep that separation in place yourself, if you want to follow the class MVC architectural patterns.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With