Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6372461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:14:32+00:00 2026-05-25T01:14:32+00:00

With current practices (at least with WPF and Silverlight) we see views bound via

  • 0

With current practices (at least with WPF and Silverlight) we see views bound via command bindings in the view model or we at least see view events handled in view models. This appears to be a violation of SRP because the view model doesn’t just model the view state, but responds to the view (user). Others have asked how to build view models without violating SRP or asked whether their implementations do so (this last is the controller in MVC, but roughly analogous).

So are current practices a violation of SRP? Or is "view model" really a collection of things that don’t violate SRP? To frame this a bit, it seems we need to know what is the single responsibility or if there are multiple responsibilities in the concept, are the individual responsibilities split out, conforming to SRP. I’m not sure.

Wikipedia’s definition of view model says

[T]he ViewModel is a “Model of the View” meaning it is an abstraction of the View that also serves in data binding between the View and the Model

This seems good enough for SRP, but then the entry later says (my emphasis added)

[The ViewModel] acts as a data binder/converter that changes Model information into View information and passes commands from the View into the Model

In a Prism blog post about the view model’s role, the author says (again, my emphasis)

What it boils down is that the view model is a composite of the following:

  • an abstraction of the view
  • commands
  • value converters
  • view state

I’m sure I’ve missed many definitions out there, but they seem to fall into these categories:

  1. Single "vague" responsibility of modeling view state (so what do we
    mean by state)
  2. Multiple responsibilities (view state, user interaction (i.e.
    commands))
  3. A composite of single specific responsibilities (abstraction,
    state, interaction, conversion), thus having a single
    responsibility: "managing all that stuff".

If you’re curious, I "care" about this because (2) feels right, but seems counter to the prevailing implementations.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:14:32+00:00Added an answer on May 25, 2026 at 1:14 am

    Single Responsibility as Martin defines it:

    “THERE SHOULD NEVER BE MORE THAN ONE REASON FOR A CLASS TO CHANGE.”

    A ViewModel, as far as MVVM is concerned is really just a specialized implementation of a Presentation Model.

    So while it could be argued that a Presentation Model should only represent the state of the UI, and that a Presenter/Controller should always broker the commands between the UI and the Presentation Model. If one follows this idea, with SRP dividing on State and Commands, then adding a command should not affect the class that represents state. Therefore MVVM would break SRP.

    However…

    I think this is grasping at straws. MVVM is a fairly specialized implementation used basically in WPF/Silverlight (and now browser clients).

    Patterns are designed to make designs simpler where the alternative would be more cumbersome or less maintainable. Since MVVM is designed to take advantage of the extremely rich data binding capabilities of the presentation technologies, then it is a worthwhile trade off.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a silverlight app using Prism practices; the current code does a search
What are the current best practices in the Rails world for displaying a calendar
Why Microsoft.Practices.ServiceLocation.IServiceLocator does not offer TryGetInstance()? I need to get generic validator instance ServiceLocator.Current.GetInstance<IEntityValidator<TEntity>>()
Following current best practices, what is the proper role for each of these? Based
For a current project I'm creating a data model. Are there any sources where
Could someone please advise the current best practice around Date and Calendar types. When
I'm learning Grails/GORM and as I've understood it the current best practice is not
In my current job the supervisor's practice is to only check in production ready
Current, I've got a stored procedure that has a main goal of doing a
Current situation: Ubuntu 8.04 server edition (live server) Postgresql 8.3.7 (from standard repositories) Postgis

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.