1

I am a newbie to C#, & i want to learn MVC plain pattern with Win-from example. I have almost most of the SO links but most of them referred to some useful links which are explained about the concepts.Looking for clean WinForms MVC tutorial for C# I tried to download source code from some links but i couldn't succeed.

According to my knowledge what MVC means:

  • View gets the user input and send it to the controller.
  • Controller informs the model in-response to the user input.
    • It can modify view directly
  • Model notifies the view of the change.
  • View updates itself based on changes to model.

Please correct me if the above concept is wrong.

I'm working on a small project to learn about MVC Winfroms.. I have shared my project here in these links. https://rapidshare.com/files/328097704/MVCCustomerRecords.rar https://skydrive.live.com/redir?resid=8FE34CB77340CAA9!145

The idea of this project to create a customer records and save it in a XML file. I got four functions 1.Create 2.Update 3.Remove and 4.Search by ID

I have finished the finished 1st function but I don't know how to proceed with the other functions. Please assist me with the example project and please correct me if the MVC pattern is wrong in this project.

XML File:

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfCustomerRecordsItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <CustomerRecordsItem>
    <CustomerID>67868</CustomerID>
    <FirstName>ert</FirstName>
    <LastName>ert</LastName>
    <Address>ertreer</Address>
    <Mobile>677786868</Mobile>
    <Country>retret</Country>
  </CustomerRecordsItem>
</ArrayOfCustomerRecordsItem>
Community
  • 1
  • 1
linguini
  • 1,939
  • 5
  • 49
  • 79
  • 1
    possible duplicate http://stackoverflow.com/questions/2406/looking-for-a-mvc-sample-for-winforms – Ozgur Dogus Jun 08 '12 at 07:54
  • View is essentially the ui, the way the data is layed out on a page. you pass it a model and it will take each part of that model and show it how you tell it to. The model is essentially the data that you will be using, is it a person with name properties ect. the controller is the layer in between that allows them to interact and tells them how to, it is what handles the posts and gets and therefore dictates which view should be used based on the circumstances – RhysW Jun 08 '12 at 08:00

1 Answers1

1

Check out this blog, it might help you out. http://uiftw.blogspot.com

You said:

According to my knowledge what MVC means

It can modify view directly

I don't think that's correct because that would create a dependency on your View inside your Controller. At that point, it starts looking a little more like MVP or Presentation Model (i.e. your controller starts to look like a presenter).

Community
  • 1
  • 1
Rodolfo Neuber
  • 3,321
  • 1
  • 19
  • 12