SlideShare a Scribd company logo
1 of 22
PureMVC GUYA.NET
Why use an application framework? Bottom line - Help us to be more efficient, more dynamic, less error prone. Good for parallel development (multiple developers). Patterns force good design. Code for the future - Easier to make changes and update. Enhance performance. Faster for new team members to start along. GUYA.NET
Spaghetti? – No thanks!!! GUYA.NET
GUYA.NET
Image Credit GUYA.NET
Why choose PureMVC I like it :) Highly documented. Community - Been out there long enough to prove it strength and maturity. More approachable, easier to understand. Out of the box better support for modular applications. Not, so old and somewhat obsolete (cairngorm). Handle views better using mediators. Open sourced with a good license (CC). GUYA.NET
Why choose PureMVC, continues Platform/context independent - no need to worry about updating Flex versions. Will be much easier to support more platforms (e.g. Pure Flash (mobile), Ajax, WPF, etc’) Scalability – Cope with big applications. Flexibility – Easy to extend. Clean implementation – Hides the singletons, uses a main Façade. GUYA.NET
The PureMVC Meta Pattern MVC Singleton Command Mediator Observer Value Object GUYA.NET
GUYA.NET
Main Actors Model – Proxies hold the model VO’s, also take care of remote services. View – Mediators encapsulate unaware UI components. Controller – Commands, can be think of as encapsulated autonomous functionality untied to an owner. GUYA.NET
Notifications - Internal communication PureMVC uses notification (Similar to Flash Event). All actors can send and listen to notifications. sendNotification(name, body, type); Data can be sent along inside a notification’s body. GUYA.NET
Model - Proxy Encapsulate the data object. Interact with remote services. Provide an API to access the data and the proxy functionalities. Send notification to the rest of the system. e.g. DATA_HAS_CHANGED Can use delegates, helpful when many proxies use the same remote object. GUYA.NET
View – Mediators Mediators interact with the public API of the view components. A view component is any UI component regardless of its complexity. Should encapsulate as much of  its own states and operations, and expose as simple as possible API. Sends and receives notifications to communicate with the rest of the application. Shouldn’t handle large amount of notifications. Should hold no complicated logic (Business logic belongs to commands) facade.removeMediator( this.getMediatorName() ); GUYA.NET
Controller - Commands Commands handle the business logic of the application. Commands are mapped to notifications and are never called directly. registerCommand( LOGIN, LoginCommand ); Coordinates the Model and View states. Used for complex actions and business logic, e.g. transactions. GUYA.NET
Communication best practice Mediator -> Proxy (can reference a proxy for data. One way coupling) Mediator -> Command -> Proxy (Better) (Proxies don’t handle notifications) Mediator -> Notification/Command -> Mediator Proxy -> Notification/Command -> Mediator Commands -> Mediator/Proxy (can interact with mediators and proxies). GUYA.NET
Demo GUYA.NET
Lets see some code GUYA.NET
PureMVC cons Platform/Context independent – Doesn’t utilize Flash/Flex capabilities. E.g. not using Flash’s events system – has it’s own notification system. Still uses a lot of singletons (Hidden in a easy to use façade). Not the best for unit testing. For max flexibility everything is typed as an Object – Lots of casting needs to be done. GUYA.NET
Can we SCRUM it? By nature the architecture encourage separation of concerns - Model, View and Controller. The layers are completely autonomous, e.g. the views are completely unconcerned about the rest of the app. Can be developed by different developers and be “tied” easily.  Easier to separate stories into tasks since things are separated by default. In the end of the sprint we’ll have much more efficient code with less bugs. Will be much easier to debug in these final critical hours (Even with other people code). GUYA.NET
Implementation - Our main challenges Making changes and being dynamic is always more difficult. Especially when things are relatively working. A lot of code will be thrown and/or refactored. A lot of proprietary knowledge will be thrown, In favor of common best practices. GUYA.NET
More about performance Things will happen when it should and only when it should. E.g. setting a dataProvider only once instead of unneeded multiple times. We will be able to kill heavy UI components, and even unload modules at runtime. Currently we can't do it since unload/killing component isn't freeing their memory. Mostly because it's still referenced in multiple places of the application. GUYA.NET
Bonus – Flex PMD http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD Flex Builder PMD tool: http://flashmattic.blogspot.com/2009/09/flexpmd-from-flex-builder.html GUYA.NET

More Related Content

Similar to PureMVC

Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Brian Brazil
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechDivante
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with RailsPaul Gallagher
 
LvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemLvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemVlad Fedosov
 
ngStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitecturengStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitectureIshaan Puniani
 
What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1
What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1
What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1AVEVA
 
Pete Marshall - casmadrid2015 - Continuous Delivery in Legacy Environments
Pete Marshall - casmadrid2015 - Continuous Delivery in Legacy EnvironmentsPete Marshall - casmadrid2015 - Continuous Delivery in Legacy Environments
Pete Marshall - casmadrid2015 - Continuous Delivery in Legacy EnvironmentsPeter Marshall
 
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...Jitendra Bafna
 
Oo Design And Patterns
Oo Design And PatternsOo Design And Patterns
Oo Design And PatternsAnil Bapat
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitectureABDEL RAHMAN KARIM
 
IT 8003 Cloud ComputingFor this activi.docx
IT 8003 Cloud ComputingFor this activi.docxIT 8003 Cloud ComputingFor this activi.docx
IT 8003 Cloud ComputingFor this activi.docxvrickens
 
XML2Selenium Technical Presentation
XML2Selenium Technical PresentationXML2Selenium Technical Presentation
XML2Selenium Technical Presentationjazzteam
 
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
 
Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)VMware Tanzu
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021NeerajKumar1965
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Brian Brazil
 

Similar to PureMVC (20)

Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)Microservices and Prometheus (Microservices NYC 2016)
Microservices and Prometheus (Microservices NYC 2016)
 
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speechVue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
 
Multi-tenancy with Rails
Multi-tenancy with RailsMulti-tenancy with Rails
Multi-tenancy with Rails
 
LvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design SystemLvivCSS: Web Components as a foundation for Design System
LvivCSS: Web Components as a foundation for Design System
 
ngStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend ArchitecturengStockholm #8 at NetEnt - Micro Frontend Architecture
ngStockholm #8 at NetEnt - Micro Frontend Architecture
 
What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1
What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1
What is New in Wonderware InduSoft Web Studio 8.0+SP1+Patch 1
 
Pete Marshall - casmadrid2015 - Continuous Delivery in Legacy Environments
Pete Marshall - casmadrid2015 - Continuous Delivery in Legacy EnvironmentsPete Marshall - casmadrid2015 - Continuous Delivery in Legacy Environments
Pete Marshall - casmadrid2015 - Continuous Delivery in Legacy Environments
 
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
MuleSoft Surat Virtual Meetup#16 - Anypoint Deployment Option, API and Operat...
 
Oo Design And Patterns
Oo Design And PatternsOo Design And Patterns
Oo Design And Patterns
 
DevOps explained
DevOps explainedDevOps explained
DevOps explained
 
Over view of software artitecture
Over view of software artitectureOver view of software artitecture
Over view of software artitecture
 
Dark launch
Dark launchDark launch
Dark launch
 
IT 8003 Cloud ComputingFor this activi.docx
IT 8003 Cloud ComputingFor this activi.docxIT 8003 Cloud ComputingFor this activi.docx
IT 8003 Cloud ComputingFor this activi.docx
 
XML2Selenium Technical Presentation
XML2Selenium Technical PresentationXML2Selenium Technical Presentation
XML2Selenium Technical Presentation
 
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
 
Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)Evolving to Cloud-Native - Nate Schutta (1/2)
Evolving to Cloud-Native - Nate Schutta (1/2)
 
Distributed Tracing
Distributed TracingDistributed Tracing
Distributed Tracing
 
Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021Nyc mule soft_meetup_13_march_2021
Nyc mule soft_meetup_13_march_2021
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
Prometheus: A Next Generation Monitoring System (FOSDEM 2016)
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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
 
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
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
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
 

PureMVC

  • 2. Why use an application framework? Bottom line - Help us to be more efficient, more dynamic, less error prone. Good for parallel development (multiple developers). Patterns force good design. Code for the future - Easier to make changes and update. Enhance performance. Faster for new team members to start along. GUYA.NET
  • 3. Spaghetti? – No thanks!!! GUYA.NET
  • 6. Why choose PureMVC I like it :) Highly documented. Community - Been out there long enough to prove it strength and maturity. More approachable, easier to understand. Out of the box better support for modular applications. Not, so old and somewhat obsolete (cairngorm). Handle views better using mediators. Open sourced with a good license (CC). GUYA.NET
  • 7. Why choose PureMVC, continues Platform/context independent - no need to worry about updating Flex versions. Will be much easier to support more platforms (e.g. Pure Flash (mobile), Ajax, WPF, etc’) Scalability – Cope with big applications. Flexibility – Easy to extend. Clean implementation – Hides the singletons, uses a main Façade. GUYA.NET
  • 8. The PureMVC Meta Pattern MVC Singleton Command Mediator Observer Value Object GUYA.NET
  • 10. Main Actors Model – Proxies hold the model VO’s, also take care of remote services. View – Mediators encapsulate unaware UI components. Controller – Commands, can be think of as encapsulated autonomous functionality untied to an owner. GUYA.NET
  • 11. Notifications - Internal communication PureMVC uses notification (Similar to Flash Event). All actors can send and listen to notifications. sendNotification(name, body, type); Data can be sent along inside a notification’s body. GUYA.NET
  • 12. Model - Proxy Encapsulate the data object. Interact with remote services. Provide an API to access the data and the proxy functionalities. Send notification to the rest of the system. e.g. DATA_HAS_CHANGED Can use delegates, helpful when many proxies use the same remote object. GUYA.NET
  • 13. View – Mediators Mediators interact with the public API of the view components. A view component is any UI component regardless of its complexity. Should encapsulate as much of its own states and operations, and expose as simple as possible API. Sends and receives notifications to communicate with the rest of the application. Shouldn’t handle large amount of notifications. Should hold no complicated logic (Business logic belongs to commands) facade.removeMediator( this.getMediatorName() ); GUYA.NET
  • 14. Controller - Commands Commands handle the business logic of the application. Commands are mapped to notifications and are never called directly. registerCommand( LOGIN, LoginCommand ); Coordinates the Model and View states. Used for complex actions and business logic, e.g. transactions. GUYA.NET
  • 15. Communication best practice Mediator -> Proxy (can reference a proxy for data. One way coupling) Mediator -> Command -> Proxy (Better) (Proxies don’t handle notifications) Mediator -> Notification/Command -> Mediator Proxy -> Notification/Command -> Mediator Commands -> Mediator/Proxy (can interact with mediators and proxies). GUYA.NET
  • 17. Lets see some code GUYA.NET
  • 18. PureMVC cons Platform/Context independent – Doesn’t utilize Flash/Flex capabilities. E.g. not using Flash’s events system – has it’s own notification system. Still uses a lot of singletons (Hidden in a easy to use façade). Not the best for unit testing. For max flexibility everything is typed as an Object – Lots of casting needs to be done. GUYA.NET
  • 19. Can we SCRUM it? By nature the architecture encourage separation of concerns - Model, View and Controller. The layers are completely autonomous, e.g. the views are completely unconcerned about the rest of the app. Can be developed by different developers and be “tied” easily. Easier to separate stories into tasks since things are separated by default. In the end of the sprint we’ll have much more efficient code with less bugs. Will be much easier to debug in these final critical hours (Even with other people code). GUYA.NET
  • 20. Implementation - Our main challenges Making changes and being dynamic is always more difficult. Especially when things are relatively working. A lot of code will be thrown and/or refactored. A lot of proprietary knowledge will be thrown, In favor of common best practices. GUYA.NET
  • 21. More about performance Things will happen when it should and only when it should. E.g. setting a dataProvider only once instead of unneeded multiple times. We will be able to kill heavy UI components, and even unload modules at runtime. Currently we can't do it since unload/killing component isn't freeing their memory. Mostly because it's still referenced in multiple places of the application. GUYA.NET
  • 22. Bonus – Flex PMD http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD Flex Builder PMD tool: http://flashmattic.blogspot.com/2009/09/flexpmd-from-flex-builder.html GUYA.NET