Skip to content

Best architectural approach for a simple MVVM program #16200

Answered by stevemonaco
reelthymeos asked this question in Q&A
Discussion options

You must be logged in to vote

I typically only make Models when:

  1. the data source is external and something I don't own (eg. web api)
  2. I want a 1:1 mapping to a persistence schema (eg. JSON/XML)

Otherwise, I put the logic into a service class (eg. a service to query / control RF devices), call it directly from the ViewModel, and assign results directly to ViewModel state.

Having a real Model layer means more indirection and that adds more pain. Sometimes with little to no value, especially for small apps with a solo dev or very small team.

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@reelthymeos
Comment options

@stevemonaco
Comment options

@reelthymeos
Comment options

Answer selected by reelthymeos
Comment options

You must be logged in to vote
2 replies
@reelthymeos
Comment options

@stevemonaco
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants