Phil Trelford's Array
POKE 36879, 255

MVMMC – MVVM grows a Controller

May 19, 2010 15:27 by phil

Ray Booysen does it again! The first time I saw Ray do a talk was at NxtGen in Cambridge, when he gave me a timely introduction to MVVM just as I was starting to play with WPF. MVVM (Model-View-View Model) is an architectural pattern, that improves on code behind, making it possible to unit test your UI code (View Model), a good thing. Over a year later and I’m just starting to play with Silverlight, Ray delivers another timely talk on Silverlight gotchas at the Edge UG in London, based on his real-world development experience (developing Financial applications). This time he introduces among other good things MVVMC (MVVM plus Controller). Here the controller takes responsibility for communication between the Model and View Model, leaving the View Model with the single responsibility of providing data to the View.

Somewhat shell shocked I was left with a few questions on implementation details, again Ray to the rescue via Twitter:

ptrelford Excellent @raybooysen Silverlight gotchas talk - MVVMC (C for controller), Network is on UI thread, browser connection limits #edgeug

ptrelford @raybooysen really liked Fat Controller slide, of Thomas the Tank Engine; controller takes responsiblity for marshalling threads etc #edgeug

raybooysen @ptrelford fat controller should be in all slide decks. :)

raybooysen Talk finished at @edge_ug. Think it went ok. Feel like I rambled a little.

ptrelford So with MVVMC the Model is observed by a Controller, which constructs & updates a View Model, which the (XAML) View binds to

raybooysen @ptrelford thanks for coming tonight. :)

ptrelford @raybooysen using MVVMC the Controller observes the Model & updates View Model, which observes user input and passes messages to the Model?

raybooysen @ptrelford viewmodel observes and notifies the the controller.

ptrelford @raybooysen thanks! So View Model takes a reference to the parent controller?

raybooysen @ptrelford no. Can surface the ui interaction via events. Or use rx if you're in for some fun.

ptrelford @raybooysen Cool thanks again! That makes sense, View Model exposes IObservable<T> properties. BTW your talk blew me away (hence questions)!

raybooysen @ptrelford no worries. Iobservable feels quite right in these scenarios. Since controller essentially owns the viewmodel

Finally, this was the same talk that Ray delivered at DDD Scotland, so the slides are already available here

image

image

image

 

image


Tags:
Categories: C# | .Net | Architecture | WPF | Silverlight
Actions: E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed

Comments

May 19. 2010 16:10

pingback

Pingback from topsy.com

Twitter Trackbacks for
        
        MVMMC – MVVM grows a Controller
        [trelford.com]
        on Topsy.com

topsy.com

May 27. 2010 02:56

pingback

Pingback from 231.mfbattle.com

1989 - 2000 @ 318ti Antenna Bmw M5, Radiator Support 1999 Bmw 318ti - 231.mfbattle.com

231.mfbattle.com

July 4. 2011 17:46

pingback

Pingback from zorbash.wordpress.com

Consulting various architectural patterns for a social networking project « Zorbash's programming stash

zorbash.wordpress.com

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading