Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design Patterns
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
01460935
Message ID:
01461146
Vues:
48
>Here's what this is all about....
>
>I got hired at a new job. They sent me a link to this http://msdn.microsoft.com/en-us/magazine/dd419663.aspx and they asked me
>to be familiar with it.
>
>The article says that the Model-View-ViewModel pattern is base off the Model-View-Presenter pattern, which is in turn based off
>the Model-View-Controller pattern. So I was reading all these articles trying to understand some history and also to understand
>the terminolgy.

If you are concentrating on MVVM (which sounds like the case) I wouldn't worry too much about it's relationship to MVP / MVC patterns - just look at it in it's own context. The problem will be that it's not so easy to understand how well it works unless you're familiar with WPF's data binding (and Commanding) design (e.g. DataTemplates)

>I get that the Model is the database, and from what I can see the View is the UI. But some portions of these articles seem to
>seperate the UI into more than one part.
>
>Then there's the Presenter and Controller. From what I can see they represent events occuring somewhere.
>
>I'm a bit lost here.

You wouldn't normally separate the View into more than one part although you might well use different views for different purposes (eg one for WPF, one for ASP.NET etc.) The main points to remember are that
(a) the Model knows *nothing* of the other layers.
(b) the ViewModel knows about the Model but *nothing* about the View.
(c) the View knows about the ViewModel (but *nothing* about the Model)

There's source code for the sample app used in the link above. I'd reccommend downloading that and looking at the way it works in practice. Shout if anything specific is confusing.
Best,
Viv



>
>>>Thanks.
>>>
>>>I'm looking at this wite here - http://www.enode.com/x/markup/tutorial/mvc.html
>>
>>FWIW if you are looking at this from a WPF POV stick to MVVM - it's far better suited to WPF than the MVC pattern because it makes it easier to build the complete view in XAML if neccessary (i.e. no code behind needed in the View)
>>
>>>
>>>I'm having a hard time understanding what these pieces represent. I get the Model. That appears to be the data layer. But the View
>>>and Controller portions are throwing me.
>>>
>>>
>>>
>>>>I neglected to point out that some design patterns are documented on the Fox Wiki. There is also info on Wikipedia. And to be obvious, a web search will bring up lots of stuff.
>>>>
>>>>
>>>>>Thanks Craig. Good info.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform