Click here to Skip to main content
15,914,386 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Clifford Nelson30-Jul-16 13:05
Clifford Nelson30-Jul-16 13:05 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Nish Nishant31-Jul-16 13:56
sitebuilderNish Nishant31-Jul-16 13:56 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Clifford Nelson30-Jul-16 13:02
Clifford Nelson30-Jul-16 13:02 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Joe Woodbury31-Jul-16 16:29
professionalJoe Woodbury31-Jul-16 16:29 
PraiseRe: Is MVVM just the functional programming paradigm for the GUI? Pin
TheGreatAndPowerfulOz1-Aug-16 11:11
TheGreatAndPowerfulOz1-Aug-16 11:11 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Super Lloyd30-Jul-16 19:10
Super Lloyd30-Jul-16 19:10 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Super Lloyd30-Jul-16 19:17
Super Lloyd30-Jul-16 19:17 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Marc Clifton31-Jul-16 4:58
mvaMarc Clifton31-Jul-16 4:58 
swampwiz wrote:
MVVM is simply the functional programming paradigm used for the GUI. Is this accurate?


No. MVVM is simply an abstract architectural pattern. A bit of history:

MVC - Model / View / Controller, was a useful concept in the sense that it separated the concerns of:
  1. model: managing the persistence of the data
  2. view: managing the display of the data and wiring up the UI events
  3. controller: the "business logic", if you will, of what to do to the model in response to UI events.
Hidden in MVC is that model events are wired up by the view, so it updates the UI when the model changes.

The theory of MVC is that each could change more-or-less independently of the other to extend the behavior of the initial design.

MVC doesn't work to well because the model is usually more closely tied to the actual database tables handling the persistence.

MVVM (Model, View, View-Model) attempts to correct that by recognizing that there is a model (usually the database tables) that doesn't map well to the UI, hence there is an intermediate "view-model" for how the UI wants to actually display the data. Think of DB views, but you can't use those as the model because DB views are usually read-only.

Note the controller is also implicit in the "view-model."

MVVM doesn't work well either, because really, the pieces that you need are:

DB model - Application model interface. The DB can still represent things in ways the application doesn't and shouldn't care about, for reasons of DB optimization, whatever. So while the two can be frequently combined, they shouldn't. One way to create a nice clean separation is to not directly have the application talk to the DB, but use a middle tier (like a REST service) that knows how to translate between DB and application models.

View model - Application model interface. This is like the "VM", in the sense that it recognizes that even the application model doesn't translate well to what the view needs.

View - controller interface. This abstraction should still be explicitly implemented so that neither the view, nor the view-model, nor the application model, do anything beyond their limited tasks. The controller is where the smarts are, updating the application model, making the necessary REST calls to update the back end, managing caching, other services (via other controllers) that come in to play, etc.

But nobody wants an acronym like DBVAVMVCRAPI

Marc
Imperative to Functional Programming Succinctly

Contributors Wanted for Higher Order Programming Project!

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Pete O'Hanlon31-Jul-16 6:11
mvePete O'Hanlon31-Jul-16 6:11 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Marc Clifton1-Aug-16 10:14
mvaMarc Clifton1-Aug-16 10:14 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
TheGreatAndPowerfulOz1-Aug-16 11:10
TheGreatAndPowerfulOz1-Aug-16 11:10 
GeneralRe: Is MVVM just the functional programming paradigm for the GUI? Pin
Marc Clifton1-Aug-16 11:17
mvaMarc Clifton1-Aug-16 11:17 
PraiseRe: Is MVVM just the functional programming paradigm for the GUI? Pin
TheGreatAndPowerfulOz1-Aug-16 11:21
TheGreatAndPowerfulOz1-Aug-16 11:21 
GeneralAutism awareness Pin
kmoorevs30-Jul-16 6:28
kmoorevs30-Jul-16 6:28 
GeneralRe: Autism awareness Pin
Cornelius Henning30-Jul-16 8:10
professionalCornelius Henning30-Jul-16 8:10 
GeneralRe: Autism awareness Pin
ZurdoDev1-Aug-16 3:10
professionalZurdoDev1-Aug-16 3:10 
GeneralRe: Autism awareness Pin
Richard MacCutchan30-Jul-16 21:37
mveRichard MacCutchan30-Jul-16 21:37 
GeneralRe: Autism awareness Pin
ZurdoDev1-Aug-16 3:11
professionalZurdoDev1-Aug-16 3:11 
GeneralRe: Autism awareness Pin
Richard MacCutchan1-Aug-16 5:02
mveRichard MacCutchan1-Aug-16 5:02 
GeneralRe: Autism awareness Pin
ZurdoDev1-Aug-16 5:04
professionalZurdoDev1-Aug-16 5:04 
GeneralRe: Autism awareness Pin
Richard MacCutchan1-Aug-16 5:06
mveRichard MacCutchan1-Aug-16 5:06 
GeneralRe: Autism awareness Pin
ZurdoDev1-Aug-16 5:07
professionalZurdoDev1-Aug-16 5:07 
GeneralRe: Autism awareness Pin
Tim Carmichael1-Aug-16 2:34
Tim Carmichael1-Aug-16 2:34 
GeneralI was sent this... Pin
OriginalGriff30-Jul-16 4:20
mveOriginalGriff30-Jul-16 4:20 
GeneralRe: I was sent this... Pin
PIEBALDconsult30-Jul-16 7:32
mvePIEBALDconsult30-Jul-16 7:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.