Sure,with pleasure.
In C# windows applications,we can implement MVC architecture.
Role of View:
1) To display the data on the UI controls.
2) For Validations .
3) view should call the controller methods.
for example,assume Employee UI
Role of Controller
1)Controller will just forward the function calls to the further down layers.
(They can be System Interface or Business interface or DA layers) and get processed them.
2)Each entity Should have its own controller
Say for example,If Employee is an entity.Fot that we will write EmployeeController.
Role of Model
1)All database related operations will be taken place here
Developing MVC in Windows applications
Step1 : create a class library(Dll) for all the data classes.i.e
Include all the data classes in a single project.So,that it is easier for us to add this dll to other projects.(like to UIProject or Sys Interface or Biz Interface or DAProject)
step2 : create a class library project and write all data access functionalities
ex: InsertEmployee(Employee emp),UpdateEmployee(Employee emp) etc
Step 3:create an interface which should have the required functionalities from the DA layers.
i.e punlic interface IEmployee
{
void InsertEmployee(Employee emp);
Void UpdateEmployee(Employee emp)
}
step 4: Create a class controller which will implement this interface methods
Step 5:Call the controller methods from the userinterface.
In between,You can have Sys,Biz layers depending on the application.
Hope this info will helpful .
If any queries,feel free to contact.
Thanks,
M.Srikrishna Murthy
Srikrishna777, if this helps please login to Mark As Answer. | Alert Moderator