android - Is my MVC and MVVM software design pattern knowledge correct? -


i want check knowledge have seen project in company in different way.

what know is, if want use mvc software design pattern in our project, separate our project this:

view part our design ui, means ui.xaml file in wpf, ui.designer.cs in winforms, ui.xml in android, ui.qml in qtquick , ui.ui in xcode.

controller part nearest source file connected designer file similar names. ui.xaml.cs file in wpf, ui.cs in winforms, ui.java in android, ui.h/ui.cpp in qtquick , ui.swift in xcode.

model part other class main operations. add suffix manager (or that) them responsibility.

and mvvm use interface or abstract class view inherited view model part , consider former controller part of view.

and 1 project enough building whole thing.

but project in company has many classes! folder of separate libraries designers name of usercontrol, folder of separate libraries name of view, , set of libraries name of viewmodel , case controller , model. , mixture of mvc , mvvm. surprising point is, whole software has 38 separate projects written single programmer , team small one.

please tell me whether knowledge correct? , please tell me if project in company in right direction?

is knowledge mvc , mvvm patterns correct? had mistake on controller(viewmodel) , think same model.

is project in right direction? doesnt seem right.

we use interfaces classes of views , viewmodels (same controllers in mvc) have better dependency management. called ioc(inversion of control) , technique of times use called dependency injection, makes class, dependent interface (not concrete impl.) using service locator or kind of service look-up object.

first of all, can mix controller mvvm handle logic codes , let viewmodel handle binding , representation of data model view, check out these series on code project: http://www.codeproject.com/articles/173618/mvvm-sharp-episode-1

but i'm not big fan of mvcvm unless use of benefits.

controllers or viewmodels separate classes views, put our logic codes in them. "ui.xaml.cs" not controller example. file file ui.xaml class. both same class call view. remember use presentation patterns separate logic codes view's code behind codes.

model object of properties grouped together. try not mix model class logic codes. models can have validation functions (.isnamevalid() example) or other functions create representation of object (.tostring() example) not logic codes (like cruds example). dont put our main operations in model. main operations in controllers(viewmodels) result model bind of view fields.

we click "search user" button, searchuser command runs function in controller , in result sets user model object property called founduser (which in controller), , view's textbox shows founduser's name.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -