Swiz Simple Flex based ViewStack Example

I am currently evaluating IOC(Inversion of Control) frameworks to use at work and have narrowed the choices down to Mate and Swiz. I had looked at the Mate framework before and also wanted to check out the new Swiz IOC framework as well.

I thought I would implement just a gui based viewstack control example before I attempted to load data into the views.

So you can view my first example of using the Swiz framework to toggle between the views in a view stack here. The view source is enabled, so just right click on the flex application to check it out.

I REALLY like the SIMPLICITY of this framework.

I like the use of the [Autowire](injection indicator) and [Mediate](event listener indicator) metadata tags to provide the IOC mechanism along with a Beans.mxml file.

The Beans.mxml object is instantiated on the Flex.PREINITIALIZE step of the code life cycle. The instances created in the Beans object can be shared and referenced by the models, views and controllers code in your project with the use of [Autowire] metadata tag.

This PREINITIALIZE step is also where the introspection engine runs to wire to the variables/functions that have the [Autowired] and [Mediate] metadata tags sprinkled throughout the project code.

In my example, I have two beans(model instance and a controller instance) which can be referenced by the views(to get the model data) and the controller(to update the model and listen for events dispatched from the views). In essence,the information that is to be shared among the models, views, and controllers is centralized in the Beans.mxml file.

Advertisements

One Response to Swiz Simple Flex based ViewStack Example

  1. […] vs Mate in a Simple Flex based ViewStack Example In my previous post, I implemented a ViewStack control using Swiz. You can review my first example of using the Swiz […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: