Mate: Cafe Townsend example updated for using Flex 4
March 12th, 2010
For an upcoming Flex 4 training I do need a good example for using Mate framework. At the moment you will find a lot of examples on Mate’s official website or at the project called “mate-examples” at Google Code. But it seems that there is not any Flex 4 example available.
Anyway, I just ported the current Cafe Townsend example (Flex 3) created by Laura Arguello to Flex 4.
It was not a big deal, because Mate supports already Flex 4. Only few changes was necessary for using new Spark components.
Also I did some little modifications in MainEventMap.mxml to start all Inject properties for any views as soon as possible listening to FlexEvent.PREINITIALIZE. Furthermore all presentation models now are not created before its view will be added. But that is what we called “cosmetic”
, because Laura has already done an awesome job building the Flex 3 example of Cafe Townsend!
Live example
[Update 03/15/2010] For a better use case of Flex 4 I have refactored the original code of the app. Now it based on a new layout and uses some effects. Last but not least the code implement a LocalEventMap to encapsulate the handling of employes, which is important if you want to use a modular app with Flex-Modules[/Update]
(To view source code just a right mouse click on the app)
Source code available
You will find the full source of Mate’s Cafe Townsend Flex 4 example at the project called ‘mate-examples’ on Google Code.
Have fun!
-Jens


April 25th, 2010 at 11:56 am
[...] demonstrate any MVC framework for using Flex or ActionScript. There are already ports of Cairngorm, Mate, PureMVC, Spring ActionScript, RobotLegs and now [...]
May 28th, 2010 at 5:01 pm
This is a great example. I guess using this pattern would be very fast to connect to a remote service and get the data from a mysql-db instead the XML. I did this with Flex3 and Zend AMF using a services-config.xml to get and save VOs. What is the correct way to do it with all the new Data/Service features of FB4.
May 31st, 2010 at 8:02 am
I did find the answer in this excellent tutorial
http://www.insideria.com/2010/05/flex-4-php-data-centric-soluti.html