SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Ähnlich wie Flex Modular Development and Mate

Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetupSyam Sasi
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info SheetMark Proctor
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projectsIBACZ
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...mfrancis
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xWong Hoi Sing Edison
 
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...Haggai Philip Zagury
 
Evolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoEvolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoVMware Tanzu
 
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudLyzun Oleksandr
 
Jdk.io cloud native business automation
Jdk.io cloud native business automationJdk.io cloud native business automation
Jdk.io cloud native business automationRyan Dawson
 
How to deploy and run mule in docker
How to deploy and run mule in dockerHow to deploy and run mule in docker
How to deploy and run mule in dockerRavi Prakash Singh
 
Extending CMS Made Simple
Extending CMS Made SimpleExtending CMS Made Simple
Extending CMS Made Simplecmsmssjg
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyMarcos Labad
 
Oracle ADF Task Flows for Beginners
Oracle ADF Task Flows for BeginnersOracle ADF Task Flows for Beginners
Oracle ADF Task Flows for BeginnersDataNext Solutions
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework Yakov Fain
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Jared Burrows
 

Ähnlich wie Flex Modular Development and Mate (20)

Vietnam qa meetup
Vietnam qa meetupVietnam qa meetup
Vietnam qa meetup
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
Liferay portals in real projects
Liferay portals  in real projectsLiferay portals  in real projects
Liferay portals in real projects
 
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
Improved developer productivity thanks to Maven and OSGi - Lukasz Dywicki (Co...
 
Drupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.xDrupal in 5mins + Previewing Drupal 8.x
Drupal in 5mins + Previewing Drupal 8.x
 
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
 
Evolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand RaoEvolving to Cloud-Native - Anand Rao
Evolving to Cloud-Native - Anand Rao
 
Reuse in adf applications
Reuse in adf applicationsReuse in adf applications
Reuse in adf applications
 
Meet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento CloudMeet Magento Spain 2019 - Our Experience with Magento Cloud
Meet Magento Spain 2019 - Our Experience with Magento Cloud
 
Jdk.io cloud native business automation
Jdk.io cloud native business automationJdk.io cloud native business automation
Jdk.io cloud native business automation
 
How to deploy and run mule in docker
How to deploy and run mule in dockerHow to deploy and run mule in docker
How to deploy and run mule in docker
 
Extending CMS Made Simple
Extending CMS Made SimpleExtending CMS Made Simple
Extending CMS Made Simple
 
Griffon demo
Griffon demoGriffon demo
Griffon demo
 
Implementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing CompanyImplementing a Symfony Based CMS in a Publishing Company
Implementing a Symfony Based CMS in a Publishing Company
 
Oracle ADF Task Flows for Beginners
Oracle ADF Task Flows for BeginnersOracle ADF Task Flows for Beginners
Oracle ADF Task Flows for Beginners
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Itb2018 integrating mvc into legacy
Itb2018   integrating mvc into legacyItb2018   integrating mvc into legacy
Itb2018 integrating mvc into legacy
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
Gradle
GradleGradle
Gradle
 

Kürzlich hochgeladen

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

Flex Modular Development and Mate

  • 1. Modular Flex Development and the Mate Framework By Gareth Edwards http://qld.cfug.org.au
  • 2. 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
  • 3. 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
  • 4. What are Modules ? ● Sub Applications compiled to SWF files that can be loaded at runtime http://qld.cfug.org.au
  • 5. 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
  • 6. 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
  • 7. Mate has the fundamentals ● Injection of Properties and / or Classes to Views and other Classes ● Event Dispatcher and Listener http://qld.cfug.org.au
  • 8. 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
  • 9. 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
  • 10. 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
  • 11. Some of the EventMap Toolbox ● EventMap / LocalEventMap ● EventHandlers ● PropertyInjector ● EventInjector ● ObjectBuilder ● MethodInvoker / ServiceInvoker http://qld.cfug.org.au
  • 12. 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
  • 13. 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
  • 14. EventInjector ● To setup function calls based on an Event. ● Example Scenario ● Change a View State based on an event ? http://qld.cfug.org.au
  • 15. ObjectBuilder ● For creating instances of Classes and to allow for additional Injection techniques through registerTarget=”true” http://qld.cfug.org.au
  • 16. 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
  • 17. 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
  • 18. Additional things ● Use <PropertyInjector softBinding=”true” … /> when needing to Inject Global Properties to Modules http://qld.cfug.org.au
  • 19. 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
  • 20. Q&A http://qld.cfug.org.au