Application logic in MVVM

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
Where to put it?

The View Model is quite tightly coupled to the View.

Unlike MVC, the business logic can be put in the Controller.
 

TrueBeliever_jh

Honorary Member
Joined
Jun 8, 2006
Messages
112,650
Reaction score
4,415
IC448690.png


5: Implementing the MVVM Pattern Using the Prism Library 5.0 for WPF

The model in the MVVM pattern encapsulates business logic and data. Business logic is defined as any application logic that is concerned with the retrieval and management of application data and for making sure that any business rules that ensure data consistency and validity are imposed. To maximize re-use opportunities, models should not contain any use case–specific or user task–specific behavior or application logic.

controller doesn't contain business logic. it should contain routing logics and calls to application layer.
 
Last edited:

u0206397

Senior Member
Joined
Jul 15, 2009
Messages
764
Reaction score
0
Compared to MVC, where model handles the data storage/retrieval and application state, and view managing the UI widgets and interactions with the user actions, there is the controller that handles the routing and application logic?

Now in MVVM, the View-Model reflects the data binding and application state/data, the View is the markup (e.g. XAML), and Models as usual the data objects and data storage/retrieval, where is the application logic and business logic?

And then some people are talking about external Service that seems to be taken from Inversion of Control (IOC) concept, which is not covered in the MVVM. Services are supposed to injected into the application, so they say. Does service replace the "C" controller in MVP or MVVM?

Seems like everyone has their own interpretation of MVC, MVP, MVVM etc.

I am :s22:
 
Important Forum Advisory Note
This forum is moderated by volunteer moderators who will react only to members' feedback on posts. Moderators are not employees or representatives of HWZ Forums. Forum members and moderators are responsible for their own posts. Please refer to our Community Guidelines and Standards and Terms and Conditions for more information.
Top