SlideShare une entreprise Scribd logo
1  sur  44
Flex London, Feb 2010



Application Frameworks
The Good, the Bad & the Ugly

          Richard Lord

         Technical Architect
             BrightTALK
         www.brighttalk.com
Application Frameworks

       Cairngorm
       PureMVC
         Mate
         Swiz
        Parsley
       RobotLegs
Coming Up
Model-View-Controller

Managing Dependencies

   Managing Events

 Presentation Patterns

What is Cairngorm 3?

Some measured opinion
Model-View-Controller

Model                View




        Controller
Managing Dependencies
                     Model
                                               View
         Model


Model
                                               View




                                               View




        Controller   Controller   Controller
Cairngorm uses global singletons
        Model Singleton
                                                    View
Model        Model        Model



                                                    View




                                                    View




           Controller     Controller   Controller
Cairngorm uses a Singleton

Model is a Singleton
  class ModelLocator implements IModelLocator {
    public static function getInstance():ModelLocator {
      ...
    }
    [Bindable]
    public var user:User;
  }


View / Controller access that Singleton
  var user:User = ModelLocator.getInstance().user;
PureMVC uses a registry
                   Model
                                                  View

        Model


Model
                                                  View
                            Model Registry




                                                  View




          Controller   Controller    Controller
Accessing the model in Pure MVC

Model is a registry of proxies
  class UserProxy extends Proxy implements IProxy {
    public function get user():User {
      ...
    }                                         Add object     to registry
  }

  facade.registerProxy( new UserProxy() );


View / Controller fetch proxies from the registry
  var userProxy:UserProxy = facade.retrieveProxy( "UserProxy" )
                                  as UserProxy;
  var user:User = userProxy.user;

                                             Fetch object from registry
Others use dependency injection
                   Model
                                                 View

        Model


Model                        Dependency          View
                              Injection
                              Container



                                                 View




          Controller   Controller   Controller
Accessing the model in Mate
Injection rules are defined in EventMaps
  <mx:Script>
   modelManager = new ModelManager();
   modelManager.user = new User();            The Model is one or
  </mx:Script>                                more regular objects

  <Injectors target="{ProfileView}">
    <PropertyInjector source="{ModelManager}" sourceKey="user"
       targetKey="user"/>
  </Injectors>
                                            Define injection rules

Properties are injected into the view
  public class ProfileView {
    public var user:User;                   This will be set by
    //...
  }
                                            the DI container
Accessing the model in Swiz

Injection rules are defined in BeanLoaders
  <BeanLoader>
   <User id="user"/>
  </BeanLoader>                            Regular object
                                          defined in MXML

BeanLoaders are instatiated in your application
  <SwizConfig beanLoaders="{[MyBeans]}">



Objects specify their requirements
  [Autowire]
  public var user:User;                      And injected into
                                              other objects
Accessing the model in RobotLegs

Injection rules are defined in a context
  class MyAppContext {
    override public function startup():void {
      injector.mapSingleton( User );
    }
                                                      Injection rules are
  }                                                 defined in the context

Context is instatiated in your application
  <MyAppContext contextView="{this}">


Objects specify their requirements
  [Inject]
  public var user:User;                         And injected into
                                                 other objects
Accessing the model in Parsley

Injection rules are defined in a configuration object
  <mx:Object>
   <User id="user"/>                      Model objects
  </mx:Object>                        are created in a config
                                              object

Configuration object is instatiated in your application
  <ContextBuilder config="{MyAppConfig}">



Objects specify their requirements
  [Inject]
  public var user:User;                   And injected into
                                           other objects
Managing Dependencies


        Singleton

         Registry

   Dependency Injection
Handling Events

Model                     View




            Controller
Event Bus
                              View     View   View




                          Event Bus




Controller   Controller   Controller
Using a single event dispatcher
                               View      View   View




                              Event
                            Dispatcher




 Controller   Controller   Controller
Using a single event dispatcher

View
  var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN);
  loginEvent.username = username.text;
  loginEvent.password = password.text;
  singleEventDispatcher.dispatchEvent( loginEvent );




Controller
  singleEventDispatcher.addEventListener( LoginEvent.LOGIN,
                               loginHandler )
View-Controller in Cairngorm
                                extends CairngormEvent
View
  var loginEvent:LoginEvent = new LoginEvent( LoginEvent.LOGIN );
  loginEvent.username = username.text;
  loginEvent.password = password.text;
  loginEvent.dispatchEvent();

Front Controller
  addCommand( LoginEvent.LOGIN, LoginCommand );

Command
  public class LoginCommand extends Command {
    public function execute( event:Event ):void {
      var loginEvent:LoginEvent = event as LoginEvent;
      ...
    }
  }
View-Controller in Pure MVC

View                                                  Notifications are
  var loginData:LoginData = new LoginData();            like Events
  loginData.username = username.text;
  loginData.password = password.text;
  sendNotification( NotificationNames.LOGIN, loginData );

Controller
  registerCommand( NotificationNames.LOGIN, LoginCommand );

Command
  public class LoginCommand extends SimpleCommand {
    public function execute( note:INotification ):void {
      var loginData: LoginData = note.getBody() as LoginData;
      ...
    }
  }
View-Controller in RobotLegs
View
 var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN);
 loginEvent.username = username.text;
 loginEvent.password = password.text;                 Reference to
 eventDispatcher.dispatchEvent( loginEvent );      central dispatcher   is
                                                         injected
Context
 commandMap.mapEvent( LoginCommand, LoginEvent.LOGIN );

Command
 public class LoginCommand extends Command {
  [Inject]
  public var event:LoginEvent;

     public function execute():void {
       ...
     }
 }
View-Controller in Parsley
                                                 Central dispatcher will
View                                              redispatch this event
 [Event(name="login",type="LoginEvent")]
 [ManagedEvents("login")]
 var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN);
 loginEvent.username = username.text;
 loginEvent.password = password.text;
 dispatchEvent( loginEvent );

Configuration
 <DynamicCommand type="" selector="login"/>

Command
  public class LoginCommand {
    public function execute( event:LoginEvent ):void {
      ...
    }
  }
View-Controller in Parsley II
                                                Central dispatcher will
View                                             redispatch this event
  [Event(name="login",type="LoginEvent")]
  [ManagedEvents("login")]
  var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN);
  loginEvent.username = username.text;
  loginEvent.password = password.text;
  dispatchEvent( loginEvent );

                                                     The method
Controller                                         handles this event

  [MessageHandler(selector="login")]
  public function loginHandler( event:LoginEvent ):void {
    ...
  }
Using the display list
      Add listeners here
                                            System Manager



                            Application                          Pop-up



Display Object             Display Object               Module



Display Object             Display Object            Display Object



Display Object             Display Object            Display Object
View-Controller in Swiz

View
  var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN, true);
  loginEvent.username = username.text;
  loginEvent.password = password.text;
  dispatchEvent( loginEvent );
                                                   Bubbling
                                                    Event


Controller
  [Mediate(event="LoginEvent.LOGIN")]
  public function loginHandler( event:LoginEvent ):void {
    ...
  }
View-Controller in Mate

View
 var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN, true);
 loginEvent.username = username.text;
 loginEvent.password = password.text;
 dispatchEvent( loginEvent );
                                                Bubbling
                                                 Event


Event Map
 <EventHandlers type="{LoginEvent.LOGIN}">
  ...
 </EventHandlers>
Mate has local event maps
   Main event map
                                     System Manager



                     Application                          Pop-up



Display Object      Display Object               Module

                                                                   Local event map

Display Object      Display Object            Display Object



Display Object      Display Object            Display Object
Event Bus


    Single Event Dispatcher
(may have multiple with access method)



           Display List
  (may use localised event handling)
Presentation Patterns

                        View     View
Model
                        logic   display




           Controller
Code Behind
View Display
  <LoginCanvas>
   <VBox>
    <TextInput id="username"/>
    <TextInput id="password"/>
    <Button click="sendLogin( username.text, password.text )"/>
   </VBox>
  </LoginCanvas>


View Logic
  class LoginCanvas extends Canvas {
    public function sendLogin( username, password ) {
      ....
    }
  }
Presentation Model
View Display
  <Canvas>
   <LoginPresentationModel id="pm"/>
   <VBox>
    <TextInput id="username"/>
    <TextInput id="password"/>
    <Button click="pm.sendLogin( username.text, password.text )"/>
   </VBox>
  </Canvas>


View Logic
  class LoginPresentationModel {
    public function sendLogin( username, password ) {
      ....
    }
  }
Supervising Controller
View Display
  <Canvas>
   <VBox>
    <TextInput id="username"/>
    <TextInput id="password"/>
    <Button click="dispatchEvent( new LoginEvent(
        LoginEvent.LOGIN, username.text, password.text ) )"/>
   </VBox>
  </Canvas>


View Logic
  class LoginController {
    public function LoginController( display:LoginDisplay ) {
      display.addEventListener( LoginEvent.LOGIN, sendLogin );
    }
    private function sendLogin( event:LoginEvent ) {
      ....
    }
  }
Passive View
View Display
  <Canvas>
   <VBox>
    <TextInput id="username"/>
    <TextInput id="password"/>
    <Button id="loginBtn"/>
   </VBox>
  </Canvas>


View Logic
  class LoginController {
    public function LoginController( display:LoginDisplay ) {
      display.loginBtn.addEventListener( MouseEvent.click, sendLogin );
    }
    private function sendLogin( event:MouseEvent ) {
      ....
    }
  }
Presentation Patterns


      Code Behind

   Presentation Model

  Supervising Controller

       Passive View        PureMVC &
                            Robotlegs
                            Mediators
Setting up the mediator
Pure MVC
 facade.registerMediator( new LoginMediator( loginView ) );


                   Logic                                      Display

RobotLegs
 mediatorMap.mapView( LoginView, LoginMediator );


       Display                                     Logic
So what is Cairngorm 3?




 Cairngorm 3 == Parsley 2.2
Summary and Opinion

      Cairngorm
      PureMVC
        Mate
        Swiz
       Parsley
      RobotLegs
Framework or Toolkit

MVC Framework      Toolkit

  Cairngorm         Swiz
  PureMVC          Parsley
    Mate          RobotLegs
Platforms


Flash & Flex     Flex only

PureMVC         Cairngorm
 Parsley          Mate
RobotLegs          Swiz
Modular features

        Yes                  No

PureMVC (multicore)       Cairngorm
       Mate           PureMVC (standard)
      Parsley
    RobotLegs
       Swiz
Community involvement

Corporate                            Community

Cairngorm                                Robotlegs
            Parsley               Swiz
                 Mate
                        PureMVC
History and evolution
Generation 1.0   Cairngorm   Out of date


                 PureMVC
Generation 1.5                 Mature
                   Mate

                   Swiz
Generation 2.0    Parsley    Cutting edge

                 RobotLegs
This is me



  www.richardlord.net

twitter.com/Richard_Lord

Contenu connexe

Tendances

Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CNjojule
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleMathias Seguy
 
Jug Guice Presentation
Jug Guice PresentationJug Guice Presentation
Jug Guice PresentationDmitry Buzdin
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right wayThibaud Desodt
 
iOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + GherkiniOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + GherkinKenneth Poon
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptmartinlippert
 
Laporan multi client
Laporan multi clientLaporan multi client
Laporan multi clientichsanbarokah
 
iOS Contact List Application Tutorial
iOS Contact List Application TutorialiOS Contact List Application Tutorial
iOS Contact List Application TutorialIshara Amarasekera
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScriptLilia Sfaxi
 
softshake 2014 - Java EE
softshake 2014 - Java EEsoftshake 2014 - Java EE
softshake 2014 - Java EEAlexis Hassler
 
Unit Test 最後一哩路
Unit Test 最後一哩路Unit Test 最後一哩路
Unit Test 最後一哩路Hokila Jan
 
iOS UI Testing in Xcode
iOS UI Testing in XcodeiOS UI Testing in Xcode
iOS UI Testing in XcodeJz Chang
 
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Theo Jungeblut
 

Tendances (20)

Vaadin 7 CN
Vaadin 7 CNVaadin 7 CN
Vaadin 7 CN
 
Google Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification GoogleGoogle Plus SignIn : l'Authentification Google
Google Plus SignIn : l'Authentification Google
 
Jug Guice Presentation
Jug Guice PresentationJug Guice Presentation
Jug Guice Presentation
 
Lab1-android
Lab1-androidLab1-android
Lab1-android
 
Dependency injection - the right way
Dependency injection - the right wayDependency injection - the right way
Dependency injection - the right way
 
iOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + GherkiniOS Automation: XCUITest + Gherkin
iOS Automation: XCUITest + Gherkin
 
Why SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScriptWhy SOLID matters - even for JavaScript
Why SOLID matters - even for JavaScript
 
Laporan multi client
Laporan multi clientLaporan multi client
Laporan multi client
 
Android 3
Android 3Android 3
Android 3
 
iOS Contact List Application Tutorial
iOS Contact List Application TutorialiOS Contact List Application Tutorial
iOS Contact List Application Tutorial
 
Google Guice
Google GuiceGoogle Guice
Google Guice
 
Client-side JavaScript
Client-side JavaScriptClient-side JavaScript
Client-side JavaScript
 
French kit2019
French kit2019French kit2019
French kit2019
 
softshake 2014 - Java EE
softshake 2014 - Java EEsoftshake 2014 - Java EE
softshake 2014 - Java EE
 
Unit Test 最後一哩路
Unit Test 最後一哩路Unit Test 最後一哩路
Unit Test 最後一哩路
 
Android UI Fundamentals part 1
Android UI Fundamentals part 1Android UI Fundamentals part 1
Android UI Fundamentals part 1
 
Deployment
DeploymentDeployment
Deployment
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
iOS UI Testing in Xcode
iOS UI Testing in XcodeiOS UI Testing in Xcode
iOS UI Testing in Xcode
 
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group Cut your Dependencies with Dependency Injection for East Bay.NET User Group
Cut your Dependencies with Dependency Injection for East Bay.NET User Group
 

Similaire à Application Frameworks - The Good, The Bad & The Ugly

Architecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVCArchitecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVCmarcocasario
 
Displaying additional image types in XMetaL
Displaying additional image types in XMetaLDisplaying additional image types in XMetaL
Displaying additional image types in XMetaLXMetaL
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Patterngoodfriday
 
Riacon swiz
Riacon swizRiacon swiz
Riacon swizntunney
 
#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps runFrederik De Bruyne
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXIMC Institute
 
Controllers & actions
Controllers & actionsControllers & actions
Controllers & actionsEyal Vardi
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinBarry Gervin
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsDan Wahlin
 
Command Query Responsibility Segregation and Event Sourcing
Command Query Responsibility Segregation and Event SourcingCommand Query Responsibility Segregation and Event Sourcing
Command Query Responsibility Segregation and Event SourcingMitinPavel
 
Parsley & Flex
Parsley & FlexParsley & Flex
Parsley & Flexprideconan
 
Inversion Of Control
Inversion Of ControlInversion Of Control
Inversion Of ControlChad Hietala
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4Naga Muruga
 
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014First Tuesday Bergen
 
iPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについてiPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについてKyosuke Takayama
 

Similaire à Application Frameworks - The Good, The Bad & The Ugly (20)

Architecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVCArchitecting ActionScript 3 applications using PureMVC
Architecting ActionScript 3 applications using PureMVC
 
Displaying additional image types in XMetaL
Displaying additional image types in XMetaLDisplaying additional image types in XMetaL
Displaying additional image types in XMetaL
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
 
Riacon swiz
Riacon swizRiacon swiz
Riacon swiz
 
#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run#win8aca : How and when metro style apps run
#win8aca : How and when metro style apps run
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
Controllers & actions
Controllers & actionsControllers & actions
Controllers & actions
 
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry GervinWill your code blend? : Toronto Code Camp 2010 : Barry Gervin
Will your code blend? : Toronto Code Camp 2010 : Barry Gervin
 
Integrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight ApplicationsIntegrating Security Roles into Microsoft Silverlight Applications
Integrating Security Roles into Microsoft Silverlight Applications
 
Command Query Responsibility Segregation and Event Sourcing
Command Query Responsibility Segregation and Event SourcingCommand Query Responsibility Segregation and Event Sourcing
Command Query Responsibility Segregation and Event Sourcing
 
Parsley & Flex
Parsley & FlexParsley & Flex
Parsley & Flex
 
Asp.Net Control Architecture
Asp.Net Control ArchitectureAsp.Net Control Architecture
Asp.Net Control Architecture
 
Inversion Of Control
Inversion Of ControlInversion Of Control
Inversion Of Control
 
From mvc to viper
From mvc to viperFrom mvc to viper
From mvc to viper
 
Behavioral pattern 4
Behavioral pattern 4Behavioral pattern 4
Behavioral pattern 4
 
Dependency Injection for Android
Dependency Injection for AndroidDependency Injection for Android
Dependency Injection for Android
 
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
Dependency Injection for Android @ Ciklum speakers corner Kiev 29. May 2014
 
Provider vs BLoC vs Redux
Provider vs BLoC vs ReduxProvider vs BLoC vs Redux
Provider vs BLoC vs Redux
 
ASP .net MVC
ASP .net MVCASP .net MVC
ASP .net MVC
 
iPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについてiPhoneOS3.1でのカメラAPIについて
iPhoneOS3.1でのカメラAPIについて
 

Dernier

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Application Frameworks - The Good, The Bad & The Ugly

  • 1. Flex London, Feb 2010 Application Frameworks The Good, the Bad & the Ugly Richard Lord Technical Architect BrightTALK www.brighttalk.com
  • 2. Application Frameworks Cairngorm PureMVC Mate Swiz Parsley RobotLegs
  • 3. Coming Up Model-View-Controller Managing Dependencies Managing Events Presentation Patterns What is Cairngorm 3? Some measured opinion
  • 4. Model-View-Controller Model View Controller
  • 5. Managing Dependencies Model View Model Model View View Controller Controller Controller
  • 6. Cairngorm uses global singletons Model Singleton View Model Model Model View View Controller Controller Controller
  • 7. Cairngorm uses a Singleton Model is a Singleton class ModelLocator implements IModelLocator { public static function getInstance():ModelLocator { ... } [Bindable] public var user:User; } View / Controller access that Singleton var user:User = ModelLocator.getInstance().user;
  • 8. PureMVC uses a registry Model View Model Model View Model Registry View Controller Controller Controller
  • 9. Accessing the model in Pure MVC Model is a registry of proxies class UserProxy extends Proxy implements IProxy { public function get user():User { ... } Add object to registry } facade.registerProxy( new UserProxy() ); View / Controller fetch proxies from the registry var userProxy:UserProxy = facade.retrieveProxy( "UserProxy" ) as UserProxy; var user:User = userProxy.user; Fetch object from registry
  • 10. Others use dependency injection Model View Model Model Dependency View Injection Container View Controller Controller Controller
  • 11. Accessing the model in Mate Injection rules are defined in EventMaps <mx:Script> modelManager = new ModelManager(); modelManager.user = new User(); The Model is one or </mx:Script> more regular objects <Injectors target="{ProfileView}"> <PropertyInjector source="{ModelManager}" sourceKey="user" targetKey="user"/> </Injectors> Define injection rules Properties are injected into the view public class ProfileView { public var user:User; This will be set by //... } the DI container
  • 12. Accessing the model in Swiz Injection rules are defined in BeanLoaders <BeanLoader> <User id="user"/> </BeanLoader> Regular object defined in MXML BeanLoaders are instatiated in your application <SwizConfig beanLoaders="{[MyBeans]}"> Objects specify their requirements [Autowire] public var user:User; And injected into other objects
  • 13. Accessing the model in RobotLegs Injection rules are defined in a context class MyAppContext { override public function startup():void { injector.mapSingleton( User ); } Injection rules are } defined in the context Context is instatiated in your application <MyAppContext contextView="{this}"> Objects specify their requirements [Inject] public var user:User; And injected into other objects
  • 14. Accessing the model in Parsley Injection rules are defined in a configuration object <mx:Object> <User id="user"/> Model objects </mx:Object> are created in a config object Configuration object is instatiated in your application <ContextBuilder config="{MyAppConfig}"> Objects specify their requirements [Inject] public var user:User; And injected into other objects
  • 15. Managing Dependencies Singleton Registry Dependency Injection
  • 16. Handling Events Model View Controller
  • 17. Event Bus View View View Event Bus Controller Controller Controller
  • 18. Using a single event dispatcher View View View Event Dispatcher Controller Controller Controller
  • 19. Using a single event dispatcher View var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN); loginEvent.username = username.text; loginEvent.password = password.text; singleEventDispatcher.dispatchEvent( loginEvent ); Controller singleEventDispatcher.addEventListener( LoginEvent.LOGIN, loginHandler )
  • 20. View-Controller in Cairngorm extends CairngormEvent View var loginEvent:LoginEvent = new LoginEvent( LoginEvent.LOGIN ); loginEvent.username = username.text; loginEvent.password = password.text; loginEvent.dispatchEvent(); Front Controller addCommand( LoginEvent.LOGIN, LoginCommand ); Command public class LoginCommand extends Command { public function execute( event:Event ):void { var loginEvent:LoginEvent = event as LoginEvent; ... } }
  • 21. View-Controller in Pure MVC View Notifications are var loginData:LoginData = new LoginData(); like Events loginData.username = username.text; loginData.password = password.text; sendNotification( NotificationNames.LOGIN, loginData ); Controller registerCommand( NotificationNames.LOGIN, LoginCommand ); Command public class LoginCommand extends SimpleCommand { public function execute( note:INotification ):void { var loginData: LoginData = note.getBody() as LoginData; ... } }
  • 22. View-Controller in RobotLegs View var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN); loginEvent.username = username.text; loginEvent.password = password.text; Reference to eventDispatcher.dispatchEvent( loginEvent ); central dispatcher is injected Context commandMap.mapEvent( LoginCommand, LoginEvent.LOGIN ); Command public class LoginCommand extends Command { [Inject] public var event:LoginEvent; public function execute():void { ... } }
  • 23. View-Controller in Parsley Central dispatcher will View redispatch this event [Event(name="login",type="LoginEvent")] [ManagedEvents("login")] var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN); loginEvent.username = username.text; loginEvent.password = password.text; dispatchEvent( loginEvent ); Configuration <DynamicCommand type="" selector="login"/> Command public class LoginCommand { public function execute( event:LoginEvent ):void { ... } }
  • 24. View-Controller in Parsley II Central dispatcher will View redispatch this event [Event(name="login",type="LoginEvent")] [ManagedEvents("login")] var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN); loginEvent.username = username.text; loginEvent.password = password.text; dispatchEvent( loginEvent ); The method Controller handles this event [MessageHandler(selector="login")] public function loginHandler( event:LoginEvent ):void { ... }
  • 25. Using the display list Add listeners here System Manager Application Pop-up Display Object Display Object Module Display Object Display Object Display Object Display Object Display Object Display Object
  • 26. View-Controller in Swiz View var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN, true); loginEvent.username = username.text; loginEvent.password = password.text; dispatchEvent( loginEvent ); Bubbling Event Controller [Mediate(event="LoginEvent.LOGIN")] public function loginHandler( event:LoginEvent ):void { ... }
  • 27. View-Controller in Mate View var loginEvent:LoginEvent = new LoginEvent(LoginEvent.LOGIN, true); loginEvent.username = username.text; loginEvent.password = password.text; dispatchEvent( loginEvent ); Bubbling Event Event Map <EventHandlers type="{LoginEvent.LOGIN}"> ... </EventHandlers>
  • 28. Mate has local event maps Main event map System Manager Application Pop-up Display Object Display Object Module Local event map Display Object Display Object Display Object Display Object Display Object Display Object
  • 29. Event Bus Single Event Dispatcher (may have multiple with access method) Display List (may use localised event handling)
  • 30. Presentation Patterns View View Model logic display Controller
  • 31. Code Behind View Display <LoginCanvas> <VBox> <TextInput id="username"/> <TextInput id="password"/> <Button click="sendLogin( username.text, password.text )"/> </VBox> </LoginCanvas> View Logic class LoginCanvas extends Canvas { public function sendLogin( username, password ) { .... } }
  • 32. Presentation Model View Display <Canvas> <LoginPresentationModel id="pm"/> <VBox> <TextInput id="username"/> <TextInput id="password"/> <Button click="pm.sendLogin( username.text, password.text )"/> </VBox> </Canvas> View Logic class LoginPresentationModel { public function sendLogin( username, password ) { .... } }
  • 33. Supervising Controller View Display <Canvas> <VBox> <TextInput id="username"/> <TextInput id="password"/> <Button click="dispatchEvent( new LoginEvent( LoginEvent.LOGIN, username.text, password.text ) )"/> </VBox> </Canvas> View Logic class LoginController { public function LoginController( display:LoginDisplay ) { display.addEventListener( LoginEvent.LOGIN, sendLogin ); } private function sendLogin( event:LoginEvent ) { .... } }
  • 34. Passive View View Display <Canvas> <VBox> <TextInput id="username"/> <TextInput id="password"/> <Button id="loginBtn"/> </VBox> </Canvas> View Logic class LoginController { public function LoginController( display:LoginDisplay ) { display.loginBtn.addEventListener( MouseEvent.click, sendLogin ); } private function sendLogin( event:MouseEvent ) { .... } }
  • 35. Presentation Patterns Code Behind Presentation Model Supervising Controller Passive View PureMVC & Robotlegs Mediators
  • 36. Setting up the mediator Pure MVC facade.registerMediator( new LoginMediator( loginView ) ); Logic Display RobotLegs mediatorMap.mapView( LoginView, LoginMediator ); Display Logic
  • 37. So what is Cairngorm 3? Cairngorm 3 == Parsley 2.2
  • 38. Summary and Opinion Cairngorm PureMVC Mate Swiz Parsley RobotLegs
  • 39. Framework or Toolkit MVC Framework Toolkit Cairngorm Swiz PureMVC Parsley Mate RobotLegs
  • 40. Platforms Flash & Flex Flex only PureMVC Cairngorm Parsley Mate RobotLegs Swiz
  • 41. Modular features Yes No PureMVC (multicore) Cairngorm Mate PureMVC (standard) Parsley RobotLegs Swiz
  • 42. Community involvement Corporate Community Cairngorm Robotlegs Parsley Swiz Mate PureMVC
  • 43. History and evolution Generation 1.0 Cairngorm Out of date PureMVC Generation 1.5 Mature Mate Swiz Generation 2.0 Parsley Cutting edge RobotLegs
  • 44. This is me www.richardlord.net twitter.com/Richard_Lord