views:

226

answers:

2

Can anyone direct me towards some code or a tutorial for implementing the ViewModel in Flex 3?

All I'm finding on the web are examples for Silverlight.

+1  A: 

The reason all of the examples your finding are for Silverlight is because MVVM is by-and-large a Microsoft invention. It has to do with the ease of tying WPF views with data. The "ViewModel" is little more than a way of describing a subset of functions performed by the Controller in a traditional MVC design model; some MVVM descriptions even include a controller.

With that said, it doesn't really matter whether your app follows the MVVM or MVC models precisely. It's more of a high-level, organizational idea that should guide your design and development. If you're totally clueless about the models you can find any number of quickie web tutorials, and probably some printed literature on the subject.

iandisme
+3  A: 

Martin Fowler has also written about these ideas in the past under the term "Presentation Model". So you might find useful tutorials under that search phrase as well since it's not an "M$ invented term". :-)

Indeed, this M$ overview material acknowledges Fowler's work directly

In 2005, John Gossman, currently one of the WPF and Silverlight Architects at Microsoft, unveiled the Model-View-ViewModel (MVVM) pattern on his blog. MVVM is identical to Fowler's Presentation Model, in that both patterns feature an abstraction of a View, which contains a View's state and behavior. Fowler introduced Presentation Model as a means of creating a UI platform-independent abstraction of a View, whereas Gossman introduced MVVM as a standardized way to leverage core features of WPF to simplify the creation of user interfaces. In that sense, I consider MVVM to be a specialization of the more general PM pattern, tailor-made for the WPF and Silverlight platforms.

verveguy
+1 for schooling me and for appropriate use of the dollar sign
iandisme