Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
mvcExpress (simplest and fastest ActionScript 3 MVC framework) training courseRaimundas Baneviciusraima156@yahoo.comsenior...
About me●   Hi, My name is Raimundas Banevicius, and I love flash!●   I work with flash technology from 2000.07●   I work ...
About this course●   You will learn:    ○     How to create applications using mvcExpress framework    ○     MVC pattern t...
Learning curve●   Most frameworks has steep initial learning curve...●   ...but then you done with it - you will fly!●   B...
MVC architecturemvcExpress training course   part 1Raimundas Baneviciusraima156@yahoo.comsenior flash developer2012.03.24
What will be covered●   What is MVC pattern●   MVC parts●   Model ,View, Controller overview●   Communication overview●   ...
What is MVC pattern●   MVC is architectural pattern used to construct your application.    ○    it main purpose is separat...
MVC partsModel                                                                 View ●   Stores data                       ...
mvcExpress ModelModel                              userName:String;                                   moneyAmmount:int;   ...
mvcExpress ModelModel                             userName:String;                                 InventoryProxy     User...
mvcExpress View                                   menuBtn:Button;View                                   label:TextField;  ...
mvcExpress View                                 menuBtn:Button;View                                 label:TextField;     M...
mvcExpress Controller                    function startNewGame(){Controller                // change game state to represe...
mvcExpress Controller                StartNewGameCommandController                      // change game state to represent ...
mvcExpress parts, recapModel                                                                View                          ...
mvcExpress communicationsModel                                                                View                        ...
mvcExpress modulesModule    Model                                        View    Deals with data by                       ...
Thanks for listening!mvcExress framwork resources:  ● mvcExpress homepage:      http://mvcexpress.org/  ● Code on GitHub: ...
Upcoming SlideShare
Loading in …5
×

mvcExpress training course : part1

5,402 views

Published on

What is MVC architecture in general.
How MVC is implemented in mvcExpress.
How communication is implemented ir mvcExpress.

Published in: Technology, Education

mvcExpress training course : part1

  1. 1. mvcExpress (simplest and fastest ActionScript 3 MVC framework) training courseRaimundas Baneviciusraima156@yahoo.comsenior flash developer2012.03.24
  2. 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 dont like about those framework.● I build mvcExpress framework to solve those problems.
  3. 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 dont need any knowledge of other frameworks.
  4. 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! Dont 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.)● dont forget to have fun! (start with small-fun application before starting big commercial projects)
  5. 5. MVC architecturemvcExpress training course part 1Raimundas Baneviciusraima156@yahoo.comsenior flash developer2012.03.24
  6. 6. What will be covered● What is MVC pattern● MVC parts● Model ,View, Controller overview● Communication overview● mvcExpress module overview
  7. 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 dont 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. 8. MVC partsModel 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. 9. mvcExpress ModelModel 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. 10. mvcExpress ModelModel 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. 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 Buttons or TextFields) ● containers that hold simple views or other containers. ● containers that hold collections or arrays of other views.
  12. 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(Buttons. TextFields), 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. 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 dont 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 usingdifferent parts of application.
  14. 14. mvcExpress Controller StartNewGameCommandController // 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. 15. mvcExpress parts, recapModel View Deals with view objects by usingDeals with data by using Proxies. Mediators Proxy Mediator Proxy Mediator Proxy Mediator Controller Deals with business logic by using Commands Command Command Command
  16. 16. mvcExpress communicationsModel View Deals with view objects by usingDeals 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. 17. mvcExpress modulesModule Model View Deals with data by Deals with view objects using Proxies. by using Mediators Controller Deals with business logic by using CommandsModule 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. 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/

×