New Posts New Posts RSS Feed: View Model architecture
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

View Model architecture

 Post Reply Post Reply Page  <12
Author
Peer View Drop Down
Newbie
Newbie
Avatar

Joined: 31-Aug-2010
Location: Netherlands
Posts: 15
Post Options Post Options   Quote Peer Quote  Post ReplyReply Direct Link To This Post Topic: View Model architecture
    Posted: 13-Oct-2010 at 12:06am
From my perspective I use  1 repository as a wrapper for 1 entity.  This is not wat Ward suggested in this post before... The Items and CurrentItem properties of he repository gives me a clean and consequent binding interface. I'm in the middle of a test-evaluation process and can not share code with you at this time. I think your discission is about 1 or more entities in one repository.

  • for 1 entity per repository: (my way)
     The hard way is to make 1 generic class
    A more simple way is to make a baseclass and subclasses for yout entities

  • for more entities per repository (Ward's preferred way)
    Make a class containing 1 or more observable collections, create factorymethods which you can fire from you viewmodel

  • Add commands to your viewmodel which you can bind to xaml (MVVMlight V3.  ->commands ) works fine for me .

I'm a newbie to .net, sl, MVVM and all the other techniques an it takes a lot of effort to make these concepts working so far. Just keep reading and looking for demo's. I realy do  recommend the MVVMlight toolkit  to you, Ideablade have some demo's how to use them in your application. It takes som time to read all this, the guy who wrote this toolkit has a great video on his site.

Best regards,
Peer



Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post Posted: 17-Oct-2010 at 10:34am
Thanks for the insights, Peer. All good sense.
 
I try hard to distinguish my recommendations from my "rules". I do not have a "rule" on whether a Repository should be oriented to a single root aggregate entity (Peer's approach) or to a module-based collection of collaborating aggregate entities (the approach I recommended).  I don't have a "rule" about whether a Repository should be allowed to save or not (I have done both and probably will again).
 
Many roads can get you home.
 
I will tell you when I think a road leads through the swamp.
 
As Peer says, you have to accumulate experience and read what other folks are doing.
 
All the best,

W
Back to Top
WardBell View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 31-Mar-2009
Location: Emeryville, CA,
Posts: 338
Post Options Post Options   Quote WardBell Quote  Post ReplyReply Direct Link To This Post Posted: 27-Oct-2010 at 5:57pm
I just added my "Bad Golf" example to the DevForce Cookbook that demonstrates some of my thinking on these subjects. I've opened a Forum Topic for it here (http://www.ideablade.com/forum/forum_posts.asp?TID=2271&PID=8947#8947).
 
Please take a look and let me know what you think THERE rather than here.
 
Let's consider this thread closed in favor of the "Bad Golf" topic.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down