Friday, March 19, 2010

Rob E’s Mini-MVVM Framework @ MIX10

Rob Eisenberg’s MIX 2010 talk, “Build Your Own MVVM Framework” was terrific. If you feel modestly comfortable with MVVM, run over and get the video and the code.

Rob may be best known for his Caliburn WPF/Silverlight Presentation Development Framework. That’s a hefty body of work and if the word “framework” sends an unpleasant shiver down your spine … relax yourself.

The “framework” demonstrated at MIX is roughly 500 lines (says Rob … I haven’t checked yet <grin/>). It’s based on Caliburn but stripped to essentials that Rob covered in an easy-to-follow, leisurely, one hour code-walk.

Highlights:

  • Simple MVVM
    • "VM first" in the sense that VM is in the driver's seat.
    • No impediment to "View first" in the sense of view-design drives VM-design.
  • Simple naming conventions eliminate tedious code and XAML
  • Configuration at-the-ready when conventions fail
  • No code-behind … and didn’t miss it
  • No behaviors … and didn’t miss them (not that they’d be bad)
  • No XAML data binding; debuggable bindings created at runtime
  • No drag-and-drop binding … and didn’t miss it
  • No ICommand implementations and no event handlers
  • No files over 150 lines (as I remember)
  • Cool co-routines for programming a sequence of sync and async tasks; no call backs in the ViewModel
  • Screen Conductor pattern in play

All that in one hour.

The “co-routine” trick alone is worth your time. You almost get F# “bang” syntax in C#.

It could get more complicated in your app … and you’d have Caliburn. But it might not  … and you’d be living large with dead-simple, DRY code.

One of the best sessions ever.

If only we could teach Rob to emote. The guy is passionate on the subject but you might miss it behind that mono-tone voice of his. A Jim Carrey he is not. You want entertainment? Look elsewhere. You want substance … tune in.

He got a big ovation, by-the-by, so it ain’t just me who liked it.

No comments: