|
|
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:
- model: managing the persistence of the data
- view: managing the display of the data and wiring up the UI events
- 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
|
|
|
|
|
I feel I have to offer minor clarifications here. In MVVM, there may be many models associated with a single view. I am not talking about mapping multiple database tables here, although that may be the case. The model is simply something that isn't view or view model. It's common for the VM to coordinate validation from a validation model, with calls out to cache data and so on. These would all be models and the VM is the glue that binds them together. This is because it's an architectural pattern. If it wasn't, then doing things like n tier design would be incredibly complicated.
This space for rent
|
|
|
|
|
Pete O'Hanlon wrote: I feel I have to offer minor clarifications here.
Thank you -- excellent points.
Marc
|
|
|
|
|
Don't really agree with your characterization of what a "Model" is in MVC/MVVM. It doesn't really have anything to do with the DB. There should be a translation layer between the "Model" and the DB as well as between the "Model" and the view. The MVC pattern can be used for both sides.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
TheGreatAndPowerfulOz wrote: It doesn't really have anything to do with the DB. There should be a translation layer between the "Model" and the DB as well as between the "Model" and the view.
Exactly, which is why I came up with the acronym that would never be used.
Marc
|
|
|
|
|
Understood.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
The 7y/o autistic granddaughter of a close friend drowned just a couple of days ago. During the 10 minutes it took to prepare dinner, she apparently unlocked the door and walked across the street to a neighbor's pool where she had been swimming just a few days before with her mother. Yes, there was a privacy fence around the pool, but the gate wasn't locked.
Please, if you live in a neighborhood with small or autistic children and have a swimming pool, invest in a childproof lock for your pool gate.
I can't imagine what the family must be going through.
"Go forth into the source" - Neal Morse
|
|
|
|
|
Very sad indeed!
In South Africa where we used to live pool safety regulations were strictly enforced. Child proof fences with automatic child proof locks on the gates were mandatory. Something we can really copy here in the USA with all the private pools.
Get me coffee and no one gets hurt!
|
|
|
|
|
That IS the law in many places in the US.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
The problem with childproofing things is that it engenders a false sense of security. The most important thing is to take good care of your children, and always know where they are.
|
|
|
|
|
Richard MacCutchan wrote: and always know where they are. Spoken like someone who never had kids.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Just as I was beginning to gain some respect for you.
|
|
|
|
|
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
You know nothing about me or my life: how many children I've had, how many have serious life threatening diseases, or were killed or injured in accidents. So kindly keep your stupid comments to yourself.
|
|
|
|
|
Richard MacCutchan wrote: You know nothing about me I do know that you missed the smiley face in my message and seem to have no sense of humor about anything.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
My daughter is 10, soon to be 11, and is autistic.
We have a medium sized dog (about 35 pounds) that acts as a companion to my daughter and also 'shepherds' her.. if my daughter does outside, the dog follow her; when she comes back in, so does the dog. We didn't teach the dog to act this way, she instinctively did it on her own.
I am sorry for their loss; please convey my condolences and understanding.
|
|
|
|
|
...and I think I see your problem: it's a hardware bug[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Too much traffic on the B bus?
|
|
|
|
|
|
yES INDEED!
|
|
|
|
|
Charlie Gilley
<italic>Stuck in a dysfunctional matrix from which I must escape...
"Where liberty dwells, there is my country." B. Franklin, 1783
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
|
|
|
|
|
The US government took the kat (kickasstorrents) domains over the past few days.
incase you were not able to get by with alternatives like pirate bay, which have been returning intercepted HTTP requests on occasion but still works with a few retries, KAT is back:
KAT - Kickass Torrents[^]
Quote: The authorities suspended our original domain Kat.am, we have now shifted to Kickass.cd - Your support keeps us alive
“I must not fear. Fear is the mind-killer. Fear is the little-death that brings total obliteration.
I will face my fear. I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the fear has gone there will be nothing. Only I will remain.”
― Frank Herbert, Dune
|
|
|
|
|
(Underdog status) + (they're not nasty people who hurt people) - (they're hated by extremely nasty people who don't care who they hurt, as long as they can get money for nothing) = ?
Hell, you can't argue with numbers like that.
I'm British; I was hooked at "underdog".
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
How tragic. Maybe we (the software development community) should give away all the software we develop. That way they could be legal and operate with the blessing of the US government. I'm sure they'll share their profits with us so that we don't go hungry.
If they ask nicely as this I'm sure the film and music industries will do the same.
|
|
|
|