Sunday, August 9, 2009

Josh Smith is a legend

I'm creating a Salesforce Studio, and I'm doing it in WPF. Despite the fact that .net 3.0 was introduced to us back in 2006 (or ~25 Internet years ago), one still feels like a pioneer when creating something in WPF. Why have the development community (by and large) not accepted the technology to the same extent as its sister platform, WCF? Who can say? Certainly the much-documented 'learning curve' is reasonably steep - but it is undoubtedly a journey worth taking.

There are of course, some fabulous people at the forefront of the WPF community sharing their experiences with us, the humble (wannabe) programmer, supplementing msdn with their tips, tricks and tutorials. I personally follow Dr WPF, Karl Shifflet, Adam Kinney, Rob Eisenberg, Jaime Rodriguez, and my personal favourite blogger: Josh Smith. Incidentally, if I have missed anybody obvious from this list, then please pass them my profuse apologies, and let me know who and www.where such that I can correct my wrong-doings forthwith... many thanks :)

For those that would like to get into WPF, you really do need to read Josh's blog... WPF is non-trivial, a departure from the norm for practitioners of WinForms and/or asp.net development. Josh has the ability to discuss reasonably complex subject matter with clarity and authority, backing up his blogs with well-constructed, easy-to-follow code examples, typically made available on code-plex.

So it is to codeplex that our adventure begins... The idea that MVVM is a good fit for WPF, and that WPF is a good platform on which to practise MVVM had been maturing as a concept, and in February msdn published this article, which includes a link to a lightweight sample application which nicely demonstrates the core building blocks of an MVVM application:
- A ViewModelBase class which implements the INotifyPropertyChanged interface,
- a 'Workspace' framework, which reminded me of the MDI (multi-document interface) you used to see in C++ (MFC) apps of days gone by.
- A RelayCommand class which implements the ICommand interface, provided for simple commands. Allows the developer to optionally inject CanExecute logic into the constructor.

Skip forward to mid July and Josh posted an MVVM Foundation project here.

Fantastic... I have my starting point. I know my application will be sliced vertically by function: I'm going to want a login page, a SOQL helper, a text-editor for code files, and I have a few other ideas for features and functionality I want to provide in the app, too (but more on that in good time). So now, I have the framework to handle those vertical slices: For each feature, I can create a View, a ViewModel to furnish that View, and the mechanism for gluing them together, and presenting the view to the user in a consistent way.

Next time I want to talk about getting started with the salesforce.com Web Services API, and the fun and games I've been having with the DataGrid control courtesy of the WPF Toolkit (which comes baked into Studio 2010)

3 comments:

  1. Wow. I don't know what to say... Thanks for the kudos, Ian! I am very glad that my work has been so beneficial for you. Thanks!!

    Josh

    ReplyDelete
  2. I have to agree, Josh is a LEGEND!

    ReplyDelete
  3. You are most welcome! And thank *you* for your contribution to the WPF community... hands up who learned about data-binding by watching horses sliding across the screen?

    ReplyDelete