• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Flex Modular Development and Mate

Flex Modular Development and Mate



A brief look at Modular Development in Flex and the Mate framework from the ColdFusion Queensland User group meeting in August 09

A brief look at Modular Development in Flex and the Mate framework from the ColdFusion Queensland User group meeting in August 09



Total Views
Views on SlideShare
Embed Views



5 Embeds 332

http://www.flexenespannol.com 181
http://flexenespannol.blogspot.com 98
http://www.slideshare.net 49
http://feeds.feedburner.com 3
http://webcache.googleusercontent.com 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Flex Modular Development and Mate Flex Modular Development and Mate Presentation Transcript

    • Modular Flex Development and the Mate Framework By Gareth Edwards http://qld.cfug.org.au
    • What we will talk about ? ● Common Issues – What to watch out for ● Modules – Why and How ● Mate ( ma-tay ) - The Basics ● This Presentation is for people already looking at Flex ● This Presentation is mostly concepts ● Q&A http://qld.cfug.org.au
    • Common Problems ● Flex ● Maintenance of hundreds of classes ● Getting Data to Nested Parts ( or Modules ) of your Application ● Singleton ● Modules ● Sharing Events between Modules ● Sharing Data between Modules ● Populating with Data http://qld.cfug.org.au
    • What are Modules ? ● Sub Applications compiled to SWF files that can be loaded at runtime http://qld.cfug.org.au
    • Why Modules ? ● Reduces size of individual applications ● Can be loaded Dynamically ● Can be “swapped out” for other Modules ● Separating your application into smaller parts can mean it is Easier to Maintain ● Loading new Modules can mean it is easier for your Flex app to grow http://qld.cfug.org.au
    • What is Mate ? ● MXML / Flex Framework ● Inversion of Control / Dependency Injection ● Promotes “Presentation Pattern” ● Developed by ColdFusion Users ● Http : // mate.asfusion.com http://qld.cfug.org.au
    • Mate has the fundamentals ● Injection of Properties and / or Classes to Views and other Classes ● Event Dispatcher and Listener http://qld.cfug.org.au
    • EventMap / LocalEventMap ● The Configuration MXML Files ● <EventMap> is Global ● Common uses – For the Core of your application – For Authentication ● <LocalEventMap> is Local ● Events are dispatched and Handled by scope.dispatcher which is typically passed into the constructor of your PresentationModel ● Common uses – Modules http://qld.cfug.org.au
    • Manager ● Is a Class to Manage your Data ● Common Uses ● Properties to inject your Data from your EventMap ● Functions to manipulate your Data from your Event Map ● Manager is typically not for ● Dispatching Events other than property change events for binding ● http://qld.cfug.org.au
    • Presentation Pattern ● Is a design pattern ● The most apparent aspect is the “Presentation Model” ● Using classes that are typically implemented for use by a specific view, the presentation Model Encapsulates – Interaction → Event Dispatch – Model → View ● The Presentation Model Relies heavily on ● Access to data in your Managers ● Your Views having access to it http://qld.cfug.org.au
    • Some of the EventMap Toolbox ● EventMap / LocalEventMap ● EventHandlers ● PropertyInjector ● EventInjector ● ObjectBuilder ● MethodInvoker / ServiceInvoker http://qld.cfug.org.au
    • Event Handlers ● Used with Built in or Custom Events ● Common uses ● {FlexEvent.PREINITIALIZE} ● Custom Events ( {MyCustomEvent.CUSTOM} ) ● Easy to Chain Events http://qld.cfug.org.au
    • PropertyInjector ● For Injection of Properties to a View or a Registered Class based on the Class Definition ● Removes need for Parents knowing about properties that Children need ● Removes need for Singleton ● Makes dependencies easier to manage ● Works with Interfaces ● Works with Abstract Classes ● Example Scenario ● Inject Manager Properties into Presentation Model and then Presentation Model into View http://qld.cfug.org.au
    • EventInjector ● To setup function calls based on an Event. ● Example Scenario ● Change a View State based on an event ? http://qld.cfug.org.au
    • ObjectBuilder ● For creating instances of Classes and to allow for additional Injection techniques through registerTarget=”true” http://qld.cfug.org.au
    • MethodInvoker / ServiceInvoker ● Used to call internal / service functions from within other Parent Tags such as EventHandler ● Example Scenario ● {TimesheetManager} / updateWorkingDays ● {MyCFService} / updateWorkingDays http://qld.cfug.org.au
    • DataCopier ● Used to copy data from your Manager to a scope accessible for further work in the EventMap ● Example Scenario ● {TimesheetManager} / WorkingDate http://qld.cfug.org.au
    • Additional things ● Use <PropertyInjector softBinding=”true” … /> when needing to Inject Global Properties to Modules http://qld.cfug.org.au
    • Resources / Comments ● Very Active ● Lots of Examples ● Well Documented ● Although some best practices are hard to find ● Presentation Pattern is worth looking at ● Http : // mate.asfusion.com http://qld.cfug.org.au
    • Q&A http://qld.cfug.org.au