Where can I find a good example on how to completely implement the MVC pattern in Windows Forms?
I found many tutorials and code examples on various sites (for example, The Code Project and .NetHeaven), but many are more representative for the observer pattern than MVC. Since the application I want to develop is for a school project, I am reluctant to using frameworks like PureMVC or MVC#.
I am of the view that applications are so different from each other and our understanding of how applications should be written is still very limited. Past Windows Forms applications I have worked on have been so different from each other. Some of the design differences I have seen are (including most combinations):
Therefore I don’t think it’s possible to create one implementation of MVC (or MVP) that always fits well.
The best posts I have seen really explaining MVC and why an MVC system is built the way it is, is the "Build Your Own CAB" series by Jeremy D Miller. After working though it you should be able to understand your options a lot better. Microsoft's Smart Client Guidance (CAB / Microsoft Composite Application Block) should also be considered. It is a bit complex, but it can work well for applications that have a good fit.
Selecting an MVC/MVP Implementation for a Winforms Project give an overview that is worth reading. A lot of people like PureMVC. I have never used it, but I would look at it the next time I need a MVC framework.
"Presenter First" is a software development approach that combines the ideas of the Model View Presenter (MVP) design pattern and test-driven development. It lets you start off by writing tests in the customer’s language. For example:
"When I click the 'save' button then the file should be saved and the unsaved file warning should disappear.”
I have no experience using "Presenter First," but I will give it a try when I get a chance, as it looks very promising.
Other Stack Overflow questions you may may wish to look at are here and here.
If you are thinking of using WPF at any point take a look at the Model-View ViewModel (MVVM) pattern. Here is a very good video you should take a look at: Jason Dolinger on Model-View-ViewModel.
MVVM (Model View View Model) Design Pattern for Winforms give another option that may make it easer to convert to WPF if ever needed. Magical.Trevor is yet another MVVM sample for Windows Forms that also includes auto binding based on property names.
Also ask yourself why you are using MVC.
Once you are clear on your aims, it becomes easier to choose one implementation or another.