SlideShare a Scribd company logo
1 of 22
mvcExpress -
fastest and simplest
AS3 MVC frameworks

Raimundas Banevicius
Feb 14, 2012
Flash developer
1.   AS3 framework evolution
2.   simplicity
3.   performance
4.   extra perks




                               2
AS3 MVC Framework evolution
    Pros:
                                                                    Cons:

•    divide your code is small units        •     Slightly hurts performance
•    Good unit communication                •     Lot of boilerplate code.
•    Standardize your code
•    focus on app instead of architecture




+ Enforce TTD development                       - Hurts performance a lot
+ Removed most boilerplate code




                                            + Hurts performance the least
+ Enforce modular development
+ Simplifies code to the maximum            - Young framework


                                                                               3
AS3 MVC Framework evolution
    Pros:
                                                                    Cons:

•    divide your code is small units        •     Slightly hurts performance
•    Good unit communication                •     Lot of boilerplate code.
•    Standardize your code
•    focus on app instead of architecture




+ Enforce TTD development                       - Hurts performance a lot
+ Removed most boilerplate code




                                            + Hurts performance the least
+ Enforce modular development
+ Simplifies code to the maximum            - Young framework


                                                                               4
mvcExpress is simple!




                         5
mvcExpress is simple! – set up
• Set up PureMVC
   registerCommand((“startUp”, StartupCommand);

   registerProxy(new DataProxy());

   registerMediator(new GameMediator(new GameSprite()));

• Set up mvcExpress – MORE OPTIONS!
   commandMap.map(“startUp”, StartupCommand);

   commandMap.execute(AnotherCommand, new CommandParams());


   proxyMap.mapObject(new DataProxy());

   proxyMap.mapClass(DataProxy);

   mediatorMap.map(GameSprite, GameMediator);

   mediatorMap.mediate(new GameSprite());
                                                              6
mvcExpress is simple! – commands

• PureMVC:
  sendNotification(“new_message”);

    override public function execute(notice:INotification):void {
      // geting command parameters
      var params:ParamsVO = notice.getBody() as ParamsVO;

        // do stuff...
    }

• mvcExpress
  sendMessage(“new_message”);

    // geting command parameters
    public function execute(params:ParamsVO):void {

        // do stuff...
    }



                                                                    7
mvcExpress is simple! – getting stuff in commands

• PureMVC:
  // get data
  var dataProxy:DataProxy =
                facade.retrieveProxy(DataProxy.NAME) as DataProxy;


  // get mediator
   var testMediator:ViewMediator =
        facade.retrieveMediator(ViewMediator.NAME) as ViewMediator;

• mvcExpress
  // get data
  [Inject]
  public var dataProxy:DataProxy;


  // get mediator

     NOT POSSIBLE!!!
       It is bad practice to use mediators from commands.

                                                                      8
mvcExpress is simple! – Proxies

• PureMVC:
  public class PureMvcProxy extends Proxy implements IProxy {
    public static const NAME:String = "PureMvcProxy";

      public function PureMvcProxy() {
        var proxyData:DataVO = new DataVO();
        super(NAME, proxyData);
      }

      // get and cast data object for convenience..
      public function get dataVo():DataVO {
         return super.getData() as DataVO;
      }
  }
• mvcExpress
  public class MvcExpressProxy extends Proxy {

      private var dataVO:DataVO = new DataVO();

      public function MvcExpressProxy() {
      }
  }
                                                                9
mvcExpress is simple! – Mediator+View:
• PureMVC:
  public class PureMvcMediator extends Mediator implements IMediator {
    public static const NAME:String = "PureMvcMediator";

    public function PureMvcMediator(initViewComponent:ViewComponent) {
      super(NAME, initViewComponent);
    }

    // cast view for convenient local use.
    public function get view():ViewComponent {
        return super.getViewComponent() as ViewComponent;
    }

    // listen for framework notices
    override public function listNotificationInterests():Array {
        return [ //
           DataNote.STUFF_DONE //
           ];
    }

    // handle framework events
    override public function handleNotification(notice:INotification):void {
        switch (notice.getName()) {
          case DataNote.STUFF_DONE:
             // do stuff…
          break;
  } } }                                                                        10
mvcExpress is simple! – Mediator+View:
• PureMVC:
  public class PureMvcMediator extends Mediator implements IMediator {
    public static const NAME:String = "PureMvcMediator";

    public function PureMvcMediator(initViewComponent:ViewComponent) {
      super(NAME, initViewComponent);
    }

    // cast view for convenient local use.
    public function get view():ViewComponent {
        return super.getViewComponent() as ViewComponent;
    }

    // listen for framework notices
    override public function listNotificationInterests():Array {
        return [ //
           DataNote.STUFF_DONE //
           ];
    }

    // handle framework events
    override public function handleNotification(notice:INotification):void {
        switch (notice.getName()) {
          case DataNote.STUFF_DONE:
             // do stuff…
          break;
  } } }                                                                        11
mvcExpress is simple! – Mediator+View:
• mvcExpress:
  public class MvcExpressMediator extends Mediator {

      [Inject]
      public var view:ViewComponent;

      override public function onRegister():void {
        // listen for framework events
        addHandler(DataNote.STUFF_DONE, handleStuffDone);
      }

      // handle framework events
      private function handleStuffDone(params:DataChangeParamsVO):void {
          view.showStuff(params.dataParam1);
      }
  }




                                                                           12
mvcExpress is fast!




                       13
mvcExpress is fast! - Command execution

                      1600

                      1400

                      1200
Executions per 1 ms




                      1000

                      800                                                            RobotLegs
                                                                                     PureMVC
                      600
                                                                                     mvcExpress
                      400

                      200

                        0
                             with nothing:      with      with Model:   Model and
                                             parameter:                 View call:

                                                                                                  14
mvcExpress is fast! - Command execution

                      1600

                      1400

                      1200
Executions per 1 ms




                      1000

                      800                                                            RobotLegs
                                                                                     PureMVC
                      600
                                                                                     mvcExpress
                      400

                      200

                        0
                             with nothing:      with      with Model:   Model and
                                             parameter:                 View call:

                                                                                                  15
mvcExpress is fast! - mediator registering / removal

                      100
                      90
                      80
Executions per 1 ms




                      70
                      60
                      50                                                      RobotLegs
                      40                                                      PureMVC
                      30                                                      mvcExpress

                      20
                      10
                       0
                            Register Register Register Remove Remove Remove
                             1000:    2000:    5000:    1000:  2000:  5000:

                                                                                           16
mvcExpress is fast! - mediator registering / removal

                      100
                      90
                      80
Executions per 1 ms




                      70
                      60
                      50                                                      RobotLegs
                      40                                                      PureMVC
                      30                                                      mvcExpress

                      20
                      10
                       0
                            Register Register Register Remove Remove Remove
                             1000:    2000:    5000:    1000:  2000:  5000:

                                                                                           17
mvcExpress is fast! – communication speed

                      25000


                      20000
Executions per 1 ms




                      15000

                                                                                        RobotLegs
                      10000
                                                                                        PureMVC
                                                                                        mvcExpress
                      5000


                          0
                              1 receiving   100        200        500        1000
                              mediators: receiving receiving receiving receiving
                                          mediators: mediators: mediators: mediators:

                                                                                                     18
mvcExpress is fast! – communication speed

                      25000


                      20000
Executions per 1 ms




                      15000

                                                                                        RobotLegs
                      10000
                                                                                        PureMVC
                                                                                        mvcExpress
                      5000


                          0
                              1 receiving   100        200        500        1000
                              mediators: receiving receiving receiving receiving
                                          mediators: mediators: mediators: mediators:

                                                                                                     19
Extra perks


• Hard to misuse:
In mvcExpress you will have - what you need, where you need it.
No more no less.


• Modular:
Want it or not – you will be creating reusable modules by extending
ModuleCore.as class.



• Helps avoid errors:
mvcExpress uses conditional compilation very extensively!
Add ”-define+=CONFIG::DEBUG,true” to benefit from better error checking and
warnings.

                                                                              20
Check it out!


• Code on gitHub:
https://github.com/MindScriptAct/mvcExpress-framework



• mvcExpress homePage:
http://mvcexpress.org/




• My blog:
http://www.mindscriptact.com/




                                                        21
Thank you for your time!


            Questions?




                            22

More Related Content

What's hot

Spring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationSpring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationsourabh aggarwal
 
Java util concurrent
Java util concurrentJava util concurrent
Java util concurrentRoger Xia
 
Java Concurrency and Asynchronous
Java Concurrency and AsynchronousJava Concurrency and Asynchronous
Java Concurrency and AsynchronousLifan Yang
 
Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02rhemsolutions
 
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
Se lancer dans l'aventure microservices avec Spring Cloud - Julien RoySe lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Royekino
 
Dive into SObjectizer 5.5. Ninth Part: Message Chains
Dive into SObjectizer 5.5. Ninth Part: Message ChainsDive into SObjectizer 5.5. Ninth Part: Message Chains
Dive into SObjectizer 5.5. Ninth Part: Message ChainsYauheni Akhotnikau
 
Parsley & Flex
Parsley & FlexParsley & Flex
Parsley & Flexprideconan
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsCarol McDonald
 
Other Approaches (Concurrency)
Other Approaches (Concurrency)Other Approaches (Concurrency)
Other Approaches (Concurrency)Sri Prasanna
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleSkills Matter
 
Qt test framework
Qt test frameworkQt test framework
Qt test frameworkICS
 
Dive into SObjectizer 5.5. Tenth part: Mutable Messages
Dive into SObjectizer 5.5. Tenth part: Mutable MessagesDive into SObjectizer 5.5. Tenth part: Mutable Messages
Dive into SObjectizer 5.5. Tenth part: Mutable MessagesYauheni Akhotnikau
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New EvolutionAllan Huang
 
Spring vs. Java EE QConSP 2012
Spring vs. Java EE QConSP 2012Spring vs. Java EE QConSP 2012
Spring vs. Java EE QConSP 2012Guilherme Moreira
 

What's hot (20)

Spring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationSpring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentation
 
Java util concurrent
Java util concurrentJava util concurrent
Java util concurrent
 
Java Concurrency and Asynchronous
Java Concurrency and AsynchronousJava Concurrency and Asynchronous
Java Concurrency and Asynchronous
 
Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02Architecting your GWT applications with GWT-Platform - Lesson 02
Architecting your GWT applications with GWT-Platform - Lesson 02
 
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
Se lancer dans l'aventure microservices avec Spring Cloud - Julien RoySe lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
Se lancer dans l'aventure microservices avec Spring Cloud - Julien Roy
 
Vue next
Vue nextVue next
Vue next
 
Dive into SObjectizer 5.5. Ninth Part: Message Chains
Dive into SObjectizer 5.5. Ninth Part: Message ChainsDive into SObjectizer 5.5. Ninth Part: Message Chains
Dive into SObjectizer 5.5. Ninth Part: Message Chains
 
Parsley & Flex
Parsley & FlexParsley & Flex
Parsley & Flex
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and Trends
 
Other Approaches (Concurrency)
Other Approaches (Concurrency)Other Approaches (Concurrency)
Other Approaches (Concurrency)
 
In the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: GradleIn the Brain of Hans Dockter: Gradle
In the Brain of Hans Dockter: Gradle
 
Qt test framework
Qt test frameworkQt test framework
Qt test framework
 
JEE.next()
JEE.next()JEE.next()
JEE.next()
 
Dive into SObjectizer 5.5. Tenth part: Mutable Messages
Dive into SObjectizer 5.5. Tenth part: Mutable MessagesDive into SObjectizer 5.5. Tenth part: Mutable Messages
Dive into SObjectizer 5.5. Tenth part: Mutable Messages
 
drmaatutggf12
drmaatutggf12drmaatutggf12
drmaatutggf12
 
Byte code field report
Byte code field reportByte code field report
Byte code field report
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 
angular2.0
angular2.0angular2.0
angular2.0
 
The Java memory model made easy
The Java memory model made easyThe Java memory model made easy
The Java memory model made easy
 
Spring vs. Java EE QConSP 2012
Spring vs. Java EE QConSP 2012Spring vs. Java EE QConSP 2012
Spring vs. Java EE QConSP 2012
 

Similar to Fastest AS3 MVC Framework

Postgres MVCC - A Developer Centric View of Multi Version Concurrency Control
Postgres MVCC - A Developer Centric View of Multi Version Concurrency ControlPostgres MVCC - A Developer Centric View of Multi Version Concurrency Control
Postgres MVCC - A Developer Centric View of Multi Version Concurrency ControlReactive.IO
 
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..Matt Walters
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for VirtualizationYoonje Choi
 
Efficient use of NodeJS
Efficient use of NodeJSEfficient use of NodeJS
Efficient use of NodeJSYura Bogdanov
 
murakumo Cloud Controller
murakumo Cloud Controllermurakumo Cloud Controller
murakumo Cloud ControllerShingo Kawano
 
Setup & Operate Tungsten Replicator
Setup & Operate Tungsten ReplicatorSetup & Operate Tungsten Replicator
Setup & Operate Tungsten ReplicatorContinuent
 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)Felix Geisendörfer
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure InteroperabilityMihai Dan Nadas
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisChong-Kuan Chen
 
New Tools and Interfaces for Managing IBM MQ
New Tools and Interfaces for Managing IBM MQNew Tools and Interfaces for Managing IBM MQ
New Tools and Interfaces for Managing IBM MQMatt Leming
 
Set Up & Operate Tungsten Replicator
Set Up & Operate Tungsten ReplicatorSet Up & Operate Tungsten Replicator
Set Up & Operate Tungsten ReplicatorContinuent
 
Dena Loves Perl
Dena Loves PerlDena Loves Perl
Dena Loves Perlnotolab
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016Peter Lawrey
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsFederico Michele Facca
 
Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Patrick Bashizi
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with SpringJoshua Long
 
Xamarin & MvvmCross in depth
Xamarin & MvvmCross in depthXamarin & MvvmCross in depth
Xamarin & MvvmCross in depthNicolas Milcoff
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBXESUG
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginnersEnoch Joshua
 

Similar to Fastest AS3 MVC Framework (20)

Postgres MVCC - A Developer Centric View of Multi Version Concurrency Control
Postgres MVCC - A Developer Centric View of Multi Version Concurrency ControlPostgres MVCC - A Developer Centric View of Multi Version Concurrency Control
Postgres MVCC - A Developer Centric View of Multi Version Concurrency Control
 
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
How to CQRS in node: Eventually Consistent, Distributed Microservice Systems..
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
 
Efficient use of NodeJS
Efficient use of NodeJSEfficient use of NodeJS
Efficient use of NodeJS
 
murakumo Cloud Controller
murakumo Cloud Controllermurakumo Cloud Controller
murakumo Cloud Controller
 
Demystifying openvswitch
Demystifying openvswitchDemystifying openvswitch
Demystifying openvswitch
 
Setup & Operate Tungsten Replicator
Setup & Operate Tungsten ReplicatorSetup & Operate Tungsten Replicator
Setup & Operate Tungsten Replicator
 
How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)How to Test Asynchronous Code (v2)
How to Test Asynchronous Code (v2)
 
Windows Azure Interoperability
Windows Azure InteroperabilityWindows Azure Interoperability
Windows Azure Interoperability
 
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware AnalysisInside the Matrix,How to Build Transparent Sandbox for Malware Analysis
Inside the Matrix,How to Build Transparent Sandbox for Malware Analysis
 
New Tools and Interfaces for Managing IBM MQ
New Tools and Interfaces for Managing IBM MQNew Tools and Interfaces for Managing IBM MQ
New Tools and Interfaces for Managing IBM MQ
 
Set Up & Operate Tungsten Replicator
Set Up & Operate Tungsten ReplicatorSet Up & Operate Tungsten Replicator
Set Up & Operate Tungsten Replicator
 
Dena Loves Perl
Dena Loves PerlDena Loves Perl
Dena Loves Perl
 
Low latency microservices in java QCon New York 2016
Low latency microservices in java   QCon New York 2016Low latency microservices in java   QCon New York 2016
Low latency microservices in java QCon New York 2016
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile Projet d'accès aux résultats des étudiant via client mobile
Projet d'accès aux résultats des étudiant via client mobile
 
Multi Client Development with Spring
Multi Client Development with SpringMulti Client Development with Spring
Multi Client Development with Spring
 
Xamarin & MvvmCross in depth
Xamarin & MvvmCross in depthXamarin & MvvmCross in depth
Xamarin & MvvmCross in depth
 
Squeak DBX
Squeak DBXSqueak DBX
Squeak DBX
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Fastest AS3 MVC Framework

  • 1. mvcExpress - fastest and simplest AS3 MVC frameworks Raimundas Banevicius Feb 14, 2012 Flash developer
  • 2. 1. AS3 framework evolution 2. simplicity 3. performance 4. extra perks 2
  • 3. AS3 MVC Framework evolution Pros: Cons: • divide your code is small units • Slightly hurts performance • Good unit communication • Lot of boilerplate code. • Standardize your code • focus on app instead of architecture + Enforce TTD development - Hurts performance a lot + Removed most boilerplate code + Hurts performance the least + Enforce modular development + Simplifies code to the maximum - Young framework 3
  • 4. AS3 MVC Framework evolution Pros: Cons: • divide your code is small units • Slightly hurts performance • Good unit communication • Lot of boilerplate code. • Standardize your code • focus on app instead of architecture + Enforce TTD development - Hurts performance a lot + Removed most boilerplate code + Hurts performance the least + Enforce modular development + Simplifies code to the maximum - Young framework 4
  • 6. mvcExpress is simple! – set up • Set up PureMVC registerCommand((“startUp”, StartupCommand); registerProxy(new DataProxy()); registerMediator(new GameMediator(new GameSprite())); • Set up mvcExpress – MORE OPTIONS! commandMap.map(“startUp”, StartupCommand); commandMap.execute(AnotherCommand, new CommandParams()); proxyMap.mapObject(new DataProxy()); proxyMap.mapClass(DataProxy); mediatorMap.map(GameSprite, GameMediator); mediatorMap.mediate(new GameSprite()); 6
  • 7. mvcExpress is simple! – commands • PureMVC: sendNotification(“new_message”); override public function execute(notice:INotification):void { // geting command parameters var params:ParamsVO = notice.getBody() as ParamsVO; // do stuff... } • mvcExpress sendMessage(“new_message”); // geting command parameters public function execute(params:ParamsVO):void { // do stuff... } 7
  • 8. mvcExpress is simple! – getting stuff in commands • PureMVC: // get data var dataProxy:DataProxy = facade.retrieveProxy(DataProxy.NAME) as DataProxy; // get mediator var testMediator:ViewMediator = facade.retrieveMediator(ViewMediator.NAME) as ViewMediator; • mvcExpress // get data [Inject] public var dataProxy:DataProxy; // get mediator NOT POSSIBLE!!! It is bad practice to use mediators from commands. 8
  • 9. mvcExpress is simple! – Proxies • PureMVC: public class PureMvcProxy extends Proxy implements IProxy { public static const NAME:String = "PureMvcProxy"; public function PureMvcProxy() { var proxyData:DataVO = new DataVO(); super(NAME, proxyData); } // get and cast data object for convenience.. public function get dataVo():DataVO { return super.getData() as DataVO; } } • mvcExpress public class MvcExpressProxy extends Proxy { private var dataVO:DataVO = new DataVO(); public function MvcExpressProxy() { } } 9
  • 10. mvcExpress is simple! – Mediator+View: • PureMVC: public class PureMvcMediator extends Mediator implements IMediator { public static const NAME:String = "PureMvcMediator"; public function PureMvcMediator(initViewComponent:ViewComponent) { super(NAME, initViewComponent); } // cast view for convenient local use. public function get view():ViewComponent { return super.getViewComponent() as ViewComponent; } // listen for framework notices override public function listNotificationInterests():Array { return [ // DataNote.STUFF_DONE // ]; } // handle framework events override public function handleNotification(notice:INotification):void { switch (notice.getName()) { case DataNote.STUFF_DONE: // do stuff… break; } } } 10
  • 11. mvcExpress is simple! – Mediator+View: • PureMVC: public class PureMvcMediator extends Mediator implements IMediator { public static const NAME:String = "PureMvcMediator"; public function PureMvcMediator(initViewComponent:ViewComponent) { super(NAME, initViewComponent); } // cast view for convenient local use. public function get view():ViewComponent { return super.getViewComponent() as ViewComponent; } // listen for framework notices override public function listNotificationInterests():Array { return [ // DataNote.STUFF_DONE // ]; } // handle framework events override public function handleNotification(notice:INotification):void { switch (notice.getName()) { case DataNote.STUFF_DONE: // do stuff… break; } } } 11
  • 12. mvcExpress is simple! – Mediator+View: • mvcExpress: public class MvcExpressMediator extends Mediator { [Inject] public var view:ViewComponent; override public function onRegister():void { // listen for framework events addHandler(DataNote.STUFF_DONE, handleStuffDone); } // handle framework events private function handleStuffDone(params:DataChangeParamsVO):void { view.showStuff(params.dataParam1); } } 12
  • 14. mvcExpress is fast! - Command execution 1600 1400 1200 Executions per 1 ms 1000 800 RobotLegs PureMVC 600 mvcExpress 400 200 0 with nothing: with with Model: Model and parameter: View call: 14
  • 15. mvcExpress is fast! - Command execution 1600 1400 1200 Executions per 1 ms 1000 800 RobotLegs PureMVC 600 mvcExpress 400 200 0 with nothing: with with Model: Model and parameter: View call: 15
  • 16. mvcExpress is fast! - mediator registering / removal 100 90 80 Executions per 1 ms 70 60 50 RobotLegs 40 PureMVC 30 mvcExpress 20 10 0 Register Register Register Remove Remove Remove 1000: 2000: 5000: 1000: 2000: 5000: 16
  • 17. mvcExpress is fast! - mediator registering / removal 100 90 80 Executions per 1 ms 70 60 50 RobotLegs 40 PureMVC 30 mvcExpress 20 10 0 Register Register Register Remove Remove Remove 1000: 2000: 5000: 1000: 2000: 5000: 17
  • 18. mvcExpress is fast! – communication speed 25000 20000 Executions per 1 ms 15000 RobotLegs 10000 PureMVC mvcExpress 5000 0 1 receiving 100 200 500 1000 mediators: receiving receiving receiving receiving mediators: mediators: mediators: mediators: 18
  • 19. mvcExpress is fast! – communication speed 25000 20000 Executions per 1 ms 15000 RobotLegs 10000 PureMVC mvcExpress 5000 0 1 receiving 100 200 500 1000 mediators: receiving receiving receiving receiving mediators: mediators: mediators: mediators: 19
  • 20. Extra perks • Hard to misuse: In mvcExpress you will have - what you need, where you need it. No more no less. • Modular: Want it or not – you will be creating reusable modules by extending ModuleCore.as class. • Helps avoid errors: mvcExpress uses conditional compilation very extensively! Add ”-define+=CONFIG::DEBUG,true” to benefit from better error checking and warnings. 20
  • 21. Check it out! • Code on gitHub: https://github.com/MindScriptAct/mvcExpress-framework • mvcExpress homePage: http://mvcexpress.org/ • My blog: http://www.mindscriptact.com/ 21
  • 22. Thank you for your time!   Questions? 22