A flex [Model] tag

If you are unfamiliar with the Presentation Model design pattern (MVVM) or declarative UI, please google and / or read the link below.

http://swizframework.jira.com/wiki/display/SWIZ/Presentation+Model
http://en.wikipedia.org/wiki/Model_View_ViewModel

Now, what I’ve done is taken this design model and made a tag for Swiz flex applications.

http://swizframework.org/

Reasons:

1. I was sick of declaring prototype beans.

2. [Model] is more clear than [Inject]… In terms of making sure people are following the pattern.

3. I did not like (but the tag does support) the idea of changing a UI state in the Model code. To me, it seems like the coder is dictating to the UI what it should be doing, instead of the UI reacting to the model and doing it’s own thing. There are ways around this, but I felt an event based method (since we are using flex) would be far better than observing a bound property.

Here is a sample application:

http://wookets.com/code/flex/ModelTagDemo/APMDemo.html

(right click to view source as always)

Here is a library

Swc: http://wookets.com/code/flex/ModelTag/bin/ModelTag.swc

Src: http://wookets.com/code/flex/ModelTag/


References:

swiz framework
http://swizframework.org/

presentation pattern (aka MVVM)
http://swizframework.jira.com/wiki/display/SWIZ/Presentation+Model
http://en.wikipedia.org/wiki/Model_View_ViewModel

a good custom tag example
http://www.ryancampbell.com/2010/03/26/introducing-the-swiz-urlmapping-metadata-processor/
http://blog.comtaste.com/2010/05/swiz_framework_custom_metadata.html

Published by and tagged Code using 182 words.