Search my blog:
Viewing By Entry / Main
May 2, 2008

cf.Objective() Session - Mate Flex Framework by Laura Arguello

The next session I will review today is by Laura Arguello of ASFusion. Mate (pronounced Mah-teh) is a tag-based Flex framework created by Nahuel Foronda that is currently in public alpha. The goals of the project waere to solve recurring problems without needing to learn a ton of design patterns while making it easy to use and making it easy to extend. The presentation was impressive and from what I can tell, anyone who uses Mach-II would feel very much at home using Mate.

The Event Map
Events are passed through the Event Map which has listeners that call the services and execute business logic. Mate helps you separate business logic from your view. Mate events extend normal Flash events rather than a framework specific event class and they behave like normal events. The event map contains Event Handlers for each type of event that your application handles; these are specified with an EventHandler tag inside the EventMap MXML. Your EventHandler can contain calls to remote objects (RemoteObjectInvoker) or business methods (MethodInvoker) or a custom handler that you can create to extend the framework.

You can make one event dependent on another by placing ResultHandlers inside the RemoteObjectInvoker, for instance, which will cause the event to run when a response is received. Mate also includes Fault Handlers to handle a failure.

Additional Features
Some other features within the framework include the ability to listen for default Flex events such as applicationComplete or initialize. You can also chain service calls as well as stop an execution chain based upon an event. Mate can also integrate with Flex Messaging using a built-in MessageHandlers tag within the Event Map. Mate also includes a Dispatcher tag that allows you to specify a Response Handler that, in conjunction with a Response Announcer in the Event Map, can notify the instance of the view that initiated the event of some form of response within the event. In addition, Listeners can be used to communicate between views.

Dependency Injection
Mate includes utilities for dependency injection using the Object Builder that even includes caching. You can inject properties directly into a view using the Property Injector allowing you to remove direct references to the model within your view. For managing complex views you create an Adapter for the view which supplies all the necessary properties using an Injectors tag that includes many Property Injectors.

Debugging
Debugging tools are included in Mate using the Debugger tag. Within each event you want to debug you include debug="true", this will output all debugging data into the debugger window. By specifying this per event it reduces the amount of data passed to the debugger, allowing you to debug only the event you are working on.

Benefits
Some of the benefits of Mate include the fact that your classes do not extend the framework, your business logic is independent of the framework and is decoupled from events and services. Also, since your events are normal events, they can be easily reused.

Comments

There are no comments for this entry.