SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
mvcExpress
 (simplest and fastest ActionScript 3 MVC framework)



 training course


Raimundas Banevicius
raima156@yahoo.com
senior flash developer
2012.03.24
About me

●   Hi, My name is Raimundas Banevicius, and I love flash!

●   I work with flash technology from 2000.07

●   I work as senior flash developer, and I build big multiplayer games

●   I rely heavily on tools and frameworks to make my work manageable and to stay productive

●   In the past I used PureMVC, Robotlegs to build games, but discovered a lot of things I don't like
    about those framework.

●   I build mvcExpress framework to solve those problems.
About this course
●   You will learn:

    ○     How to create applications using mvcExpress framework
    ○     MVC pattern theory and practice
    ○     different ways you can approach your problems, and help you pick one that suits your
          situation better.


●   You will NOT learn:

    ○     basics of ActionScript 3 programming.
    ○     Object oriented programming.



●   You don't need any knowledge of other frameworks.
Learning curve
●   Most frameworks has steep initial learning curve...

●   ...but then you done with it - you will fly!




●   Basic concepts are easy... but grasping all of them at once is challenging

    ○     learn in in small pieces! Don't try to fit everything in your head from the start!
    ○     give some time for those small pieces sit in your head.



●   you need to learn think in MVC pattern. Not only know MVC. (It will take some time.)

●   don't forget to have fun! (start with small-fun application before starting big commercial projects)
MVC architecture

mvcExpress training course   part 1

Raimundas Banevicius
raima156@yahoo.com
senior flash developer
2012.03.24
What will be covered

●   What is MVC pattern
●   MVC parts
●   Model ,View, Controller overview
●   Communication overview
●   mvcExpress module overview
What is MVC pattern
●   MVC is architectural pattern used to construct your application.

    ○    it main purpose is separation of concerns to
          ■    data domain logic (Model)
          ■    view interaction and view domain logic (View)
          ■    business logic (Controller)
    ○    uses loose coupling (objects don't have to know each other to interact)
          ■    uses messaging system for that. (Events or Signals for example)
    ○    comes in many flavours
          ■    some implementations is more strict, some are more flexible and loose.
          ■    communications(direct and indirect) can be implemented differently
●   mvcExpress is framework that uses MVC principles and tries to pick a golden middle:
    ○    it leaves options on how to approach a problem but limits it enough to prevent a mess.
    ○    communications set not only for control but also with convenience in mind
MVC parts
Model                                                                 View
 ●   Stores data                                                      ●   handles user inputs
 ●   Provides data                                                    ●   shows view change
 ●   Gives a way to change data                                       ●   implements view domain
 ●   Implements data domain logic                                         logic




                                    Controller
                                     ●   implements application
                                         business logic

                                     ●   can reacts to view inputs
                                     ●   can reacts to data changes
mvcExpress Model
Model                              userName:String;

                                   moneyAmmount:int;


                                   mapLayout:MapLayoutVO;

                                   inventory:Vector.<ItemVO>;


                                   qualityLevel:String
                                   videoSettings:VideoSettingVO;




then we write application we have to deal with all kinds of data:
  ●    simple data. (like String and int),
  ●    various Value Object classes.
  ●    complex data, like collections, or compositions of other data.
mvcExpress Model
Model                             userName:String;                                 InventoryProxy
     UserProxy                    moneyAmmount:int;


                                  mapLayout:MapLayoutVO;

                                  inventory:Vector.<ItemVO>;
     MapProxy
                                                                                   SettingsProxy

                                  qualityLevel:String
                                  videoSettings:VideoSettingVO;




Model layer of MVC is implemented using Proxy design pattern.
 ●    data is aggregated and 'hidden' inside proxy class.


 ●    proxy provides set of public functions to work with data from outside:   (uses direct communication)
mvcExpress View
                                   menuBtn:Button;
View
                                   label:TextField;

                                   main:Sprite;

                                   mapLayout:Group;

                                   gameScreen:Sprite;
                                       -menuScreen:Sprite;
                                       -windowScreen:Sprite;

                                   playField:Sprite;
                                         -ships:Vector.<Ship>;




then we write application we have to deal with all kinds of view objects:
  ●    simple view objects, or components. (like Button's or TextField's)
  ●    containers that hold simple views or other containers.
  ●    containers that hold collections or arrays of other views.
mvcExpress View
                                 menuBtn:Button;
View
                                 label:TextField;
     MainMediator                                                       GameScreenMediator
                                 main:Sprite;

                                 mapLayout:Group;

                                 gameScreen:Sprite;
                                     -menuScreen:Sprite;
     MapMediator                     -windowScreen:Sprite;                 PlayFieldMediator

                                 playField:Sprite;
                                       -ships:Vector.<Ship>;



View layer of MVC is implemented using Mediator design pattern.


 ●     view object is aggregated and 'hidden' inside mediator class.
 ●     mediators does not mediate components(Button's. TextField's), instead they mediate component containers.
 ●     mediator mediates one and only one view object. (often with children of that view object)
 ●     mediator acts as a middleman for view objects communication with rest of application. (uses indirect
       communication)
mvcExpress Controller
                    function startNewGame(){
Controller                // change game state to represent new game
                    }

                    function handleChessMove(){
                          // check if move is valid,
                          // update game board data if it is.
                          // send message to show error if it is not.
                    }

                    function addFormData(){
                          // store new form data
                          // check if form is compleated
                          // if it is - change form data state to isCompleated = true...
                    }


Then we write application we need some code to do business logic for us, or in other words do 'thinking'.
We don't want logic code to be in the View or in the Model layers - we want it separated in Controller layer!
Best way is to imagine controller as set of functions, that work with application state, and do various tasks using
different parts of application.
mvcExpress Controller
                StartNewGameCommand
Controller
                      // change game state to represent new game

                HandleChessMoveCommand

                      // check if move is valid,
                      // update game board data if it is.
                      // send message to show error if it is not.

                AddFormDataCommand

                      // store new form data
                      // check if form is compleated
                      // if it is - change form data state to isCompleated = true...



Controller layer of MVC is implemented using Command design pattern.
 ●   Best way to look at it as class-function.
 ●   Command classes are created, performs one task(function), and dies.
mvcExpress parts, recap

Model                                                                View
                                                                     Deals with view objects by using
Deals with data by using Proxies.
                                                                     Mediators
    Proxy                                                                        Mediator
       Proxy                                                                        Mediator
            Proxy                                                                           Mediator




                                Controller
                                Deals with business logic by using
                                Commands
                                            Command
                                              Command
                                                  Command
mvcExpress communications

Model                                                                View
                                                                     Deals with view objects by using
Deals with data by using Proxies.
                                                                     Mediators
    Proxy                                                                        Mediator
       Proxy                                                                        Mediator
            Proxy                                                                           Mediator




                                Controller
                                Deals with business logic by using
                                Commands
                                            Command
                                              Command                                  can get object
                                                  Command                              can send message
mvcExpress modules
Module
    Model                                        View
    Deals with data by                           Deals with view objects
    using Proxies.                               by using
                                                 Mediators



                          Controller
                          Deals with business
                          logic by using
                          Commands


Module represents:
 ● stand alone application that uses mvc architecture.
 ● stand alone module that uses mvc architecture and can be used by application
    module or other modules.
Thanks for listening!
mvcExress framwork resources:
  ● mvcExpress homepage:
      http://mvcexpress.org/

  ● Code on GitHub:
      https://github.com/MindScriptAct/mvcExpress-framework

  ● my blog:
      http://www.mindscriptact.com/

Contenu connexe

Tendances

Parsley & Flex
Parsley & FlexParsley & Flex
Parsley & Flex
prideconan
 
Other Approaches (Concurrency)
Other Approaches (Concurrency)Other Approaches (Concurrency)
Other Approaches (Concurrency)
Sri Prasanna
 
Taking Apache Camel For a Ride
Taking Apache Camel For a RideTaking Apache Camel For a Ride
Taking Apache Camel For a Ride
Bruce Snyder
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
Allan Huang
 

Tendances (20)

Qt & Webkit
Qt & WebkitQt & Webkit
Qt & Webkit
 
Spring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentationSpring 4 advanced final_xtr_presentation
Spring 4 advanced final_xtr_presentation
 
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
 
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
 
Vue next
Vue nextVue next
Vue next
 
Parsley & Flex
Parsley & FlexParsley & Flex
Parsley & Flex
 
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
 
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
 
Java Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and TrendsJava Concurrency, Memory Model, and Trends
Java Concurrency, Memory Model, and Trends
 
Qt test framework
Qt test frameworkQt test framework
Qt test framework
 
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
 
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
 
Other Approaches (Concurrency)
Other Approaches (Concurrency)Other Approaches (Concurrency)
Other Approaches (Concurrency)
 
JEE.next()
JEE.next()JEE.next()
JEE.next()
 
04b swing tutorial
04b swing tutorial04b swing tutorial
04b swing tutorial
 
drmaatutggf12
drmaatutggf12drmaatutggf12
drmaatutggf12
 
Byte code field report
Byte code field reportByte code field report
Byte code field report
 
Taking Apache Camel For a Ride
Taking Apache Camel For a RideTaking Apache Camel For a Ride
Taking Apache Camel For a Ride
 
Java New Evolution
Java New EvolutionJava New Evolution
Java New Evolution
 

Similaire à mvcExpress training course : part1

[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)
Carles Farré
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
bwullems
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
Gill Cleeren
 

Similaire à mvcExpress training course : part1 (20)

Spring Framework-II
Spring Framework-IISpring Framework-II
Spring Framework-II
 
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
Meetup  - Getting Started with MVVM Light for WPF - 11 may 2019Meetup  - Getting Started with MVVM Light for WPF - 11 may 2019
Meetup - Getting Started with MVVM Light for WPF - 11 may 2019
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
MVP Mix 2015 Leveraging MVVM on all Platforms
MVP Mix 2015  Leveraging MVVM on all PlatformsMVP Mix 2015  Leveraging MVVM on all Platforms
MVP Mix 2015 Leveraging MVVM on all Platforms
 
Architectural Design Pattern: Android
Architectural Design Pattern: AndroidArchitectural Design Pattern: Android
Architectural Design Pattern: Android
 
Training: MVVM Pattern
Training: MVVM PatternTraining: MVVM Pattern
Training: MVVM Pattern
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the information
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (1/3)
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOSSoftware architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
 
Model-View-Controller: Tips&Tricks
Model-View-Controller: Tips&TricksModel-View-Controller: Tips&Tricks
Model-View-Controller: Tips&Tricks
 
Ios development 2
Ios development 2Ios development 2
Ios development 2
 
Advanced MVVM in Windows 8
Advanced MVVM in Windows 8Advanced MVVM in Windows 8
Advanced MVVM in Windows 8
 
iOS storyboard
iOS storyboardiOS storyboard
iOS storyboard
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

mvcExpress training course : part1

  • 1. mvcExpress (simplest and fastest ActionScript 3 MVC framework) training course Raimundas Banevicius raima156@yahoo.com senior flash developer 2012.03.24
  • 2. About me ● Hi, My name is Raimundas Banevicius, and I love flash! ● I work with flash technology from 2000.07 ● I work as senior flash developer, and I build big multiplayer games ● I rely heavily on tools and frameworks to make my work manageable and to stay productive ● In the past I used PureMVC, Robotlegs to build games, but discovered a lot of things I don't like about those framework. ● I build mvcExpress framework to solve those problems.
  • 3. About this course ● You will learn: ○ How to create applications using mvcExpress framework ○ MVC pattern theory and practice ○ different ways you can approach your problems, and help you pick one that suits your situation better. ● You will NOT learn: ○ basics of ActionScript 3 programming. ○ Object oriented programming. ● You don't need any knowledge of other frameworks.
  • 4. Learning curve ● Most frameworks has steep initial learning curve... ● ...but then you done with it - you will fly! ● Basic concepts are easy... but grasping all of them at once is challenging ○ learn in in small pieces! Don't try to fit everything in your head from the start! ○ give some time for those small pieces sit in your head. ● you need to learn think in MVC pattern. Not only know MVC. (It will take some time.) ● don't forget to have fun! (start with small-fun application before starting big commercial projects)
  • 5. MVC architecture mvcExpress training course part 1 Raimundas Banevicius raima156@yahoo.com senior flash developer 2012.03.24
  • 6. What will be covered ● What is MVC pattern ● MVC parts ● Model ,View, Controller overview ● Communication overview ● mvcExpress module overview
  • 7. What is MVC pattern ● MVC is architectural pattern used to construct your application. ○ it main purpose is separation of concerns to ■ data domain logic (Model) ■ view interaction and view domain logic (View) ■ business logic (Controller) ○ uses loose coupling (objects don't have to know each other to interact) ■ uses messaging system for that. (Events or Signals for example) ○ comes in many flavours ■ some implementations is more strict, some are more flexible and loose. ■ communications(direct and indirect) can be implemented differently ● mvcExpress is framework that uses MVC principles and tries to pick a golden middle: ○ it leaves options on how to approach a problem but limits it enough to prevent a mess. ○ communications set not only for control but also with convenience in mind
  • 8. MVC parts Model View ● Stores data ● handles user inputs ● Provides data ● shows view change ● Gives a way to change data ● implements view domain ● Implements data domain logic logic Controller ● implements application business logic ● can reacts to view inputs ● can reacts to data changes
  • 9. mvcExpress Model Model userName:String; moneyAmmount:int; mapLayout:MapLayoutVO; inventory:Vector.<ItemVO>; qualityLevel:String videoSettings:VideoSettingVO; then we write application we have to deal with all kinds of data: ● simple data. (like String and int), ● various Value Object classes. ● complex data, like collections, or compositions of other data.
  • 10. mvcExpress Model Model userName:String; InventoryProxy UserProxy moneyAmmount:int; mapLayout:MapLayoutVO; inventory:Vector.<ItemVO>; MapProxy SettingsProxy qualityLevel:String videoSettings:VideoSettingVO; Model layer of MVC is implemented using Proxy design pattern. ● data is aggregated and 'hidden' inside proxy class. ● proxy provides set of public functions to work with data from outside: (uses direct communication)
  • 11. mvcExpress View menuBtn:Button; View label:TextField; main:Sprite; mapLayout:Group; gameScreen:Sprite; -menuScreen:Sprite; -windowScreen:Sprite; playField:Sprite; -ships:Vector.<Ship>; then we write application we have to deal with all kinds of view objects: ● simple view objects, or components. (like Button's or TextField's) ● containers that hold simple views or other containers. ● containers that hold collections or arrays of other views.
  • 12. mvcExpress View menuBtn:Button; View label:TextField; MainMediator GameScreenMediator main:Sprite; mapLayout:Group; gameScreen:Sprite; -menuScreen:Sprite; MapMediator -windowScreen:Sprite; PlayFieldMediator playField:Sprite; -ships:Vector.<Ship>; View layer of MVC is implemented using Mediator design pattern. ● view object is aggregated and 'hidden' inside mediator class. ● mediators does not mediate components(Button's. TextField's), instead they mediate component containers. ● mediator mediates one and only one view object. (often with children of that view object) ● mediator acts as a middleman for view objects communication with rest of application. (uses indirect communication)
  • 13. mvcExpress Controller function startNewGame(){ Controller // change game state to represent new game } function handleChessMove(){ // check if move is valid, // update game board data if it is. // send message to show error if it is not. } function addFormData(){ // store new form data // check if form is compleated // if it is - change form data state to isCompleated = true... } Then we write application we need some code to do business logic for us, or in other words do 'thinking'. We don't want logic code to be in the View or in the Model layers - we want it separated in Controller layer! Best way is to imagine controller as set of functions, that work with application state, and do various tasks using different parts of application.
  • 14. mvcExpress Controller StartNewGameCommand Controller // change game state to represent new game HandleChessMoveCommand // check if move is valid, // update game board data if it is. // send message to show error if it is not. AddFormDataCommand // store new form data // check if form is compleated // if it is - change form data state to isCompleated = true... Controller layer of MVC is implemented using Command design pattern. ● Best way to look at it as class-function. ● Command classes are created, performs one task(function), and dies.
  • 15. mvcExpress parts, recap Model View Deals with view objects by using Deals with data by using Proxies. Mediators Proxy Mediator Proxy Mediator Proxy Mediator Controller Deals with business logic by using Commands Command Command Command
  • 16. mvcExpress communications Model View Deals with view objects by using Deals with data by using Proxies. Mediators Proxy Mediator Proxy Mediator Proxy Mediator Controller Deals with business logic by using Commands Command Command can get object Command can send message
  • 17. mvcExpress modules Module Model View Deals with data by Deals with view objects using Proxies. by using Mediators Controller Deals with business logic by using Commands Module represents: ● stand alone application that uses mvc architecture. ● stand alone module that uses mvc architecture and can be used by application module or other modules.
  • 18. Thanks for listening! mvcExress framwork resources: ● mvcExpress homepage: http://mvcexpress.org/ ● Code on GitHub: https://github.com/MindScriptAct/mvcExpress-framework ● my blog: http://www.mindscriptact.com/