Presentation Model pattern with Flex and Swiz Framework<br />Piotr Walczyszyn  |  Platform Evangelist<br />
About me<br />2<br />Piotr Walczyszyn<br />Platform Evangelist<br />http://riaspace.com<br />http://twitter.com/pwalczyszy...
3<br />Presentation Model<br />
Presentation Model<br />4<br />Presentation Model<br />View<br />State & Logic<br />Provides Model data<br />Decoupled fro...
Presentation Model: Main.mxml<br />5<br />Main.mxml<br />MainPM<br />currentState:String<br /><views:MainView /><br />mode...
Presentation Model: MainView.mxml<br />6<br />MainView.mxml<br />currentState=“{model.currentState}”<br />UsersListPM<br /...
Presentation Model:UsersListView.mxml<br />7<br />UsersListView.mxml<br /><s:ListdataProvider=“{model.users}” /><br />
Presentation Model:AddUserView.mxml<br />8<br />AddUserView.mxml<br /><s:TextInput text=“@{model.user.name}” /><br />
9<br />Swiz<br />
Swiz Intro<br />Framework for Flex<br />Lightweight & flexible<br />Doesn’t enforce any design patterns, project layout or...
Swiz Features<br />Inversion of Control / Dependency Injection<br />[Inject]<br />Event handing and mediation<br />[Dispat...
Swiz Links<br />http://swizframework.org/<br />http://swizframework.jira.com/wiki/display/SWIZ/Home<br />12<br />
13<br />Demo<br />
Full Class Diagram<br />14<br />
Presentation Model pattern with Flex and Swiz framework
Upcoming SlideShare
Loading in...5
×

Presentation Model pattern with Flex and Swiz framework

2,881

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,881
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
30
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • PM is a variation of MVC design pattern.Key principals:State is in the presentation modelLogic is in the presentation modelView observes the model and updates accordinglyThe view “knows” about the presentation modelThe presentation model does not “know” about the view
  • Presentation Model pattern with Flex and Swiz framework

    1. 1. Presentation Model pattern with Flex and Swiz Framework<br />Piotr Walczyszyn | Platform Evangelist<br />
    2. 2. About me<br />2<br />Piotr Walczyszyn<br />Platform Evangelist<br />http://riaspace.com<br />http://twitter.com/pwalczyszyn<br />
    3. 3. 3<br />Presentation Model<br />
    4. 4. Presentation Model<br />4<br />Presentation Model<br />View<br />State & Logic<br />Provides Model data<br />Decoupled from View<br />Observes Model data<br />Updates Model data<br />Coupled with PM<br />
    5. 5. Presentation Model: Main.mxml<br />5<br />Main.mxml<br />MainPM<br />currentState:String<br /><views:MainView /><br />model +1<br /><swiz:Swiz /><br />
    6. 6. Presentation Model: MainView.mxml<br />6<br />MainView.mxml<br />currentState=“{model.currentState}”<br />UsersListPM<br />users:ArrayCollection<br /><views:UsersListViewincludeIn=“USERS_LIST_STATE” /><br />AddUserPM<br />user:User<br />createUser():void<br /><views:AddUserViewincludeIn=“ADD_USER_STATE” /><br />model +1<br />model +1<br />
    7. 7. Presentation Model:UsersListView.mxml<br />7<br />UsersListView.mxml<br /><s:ListdataProvider=“{model.users}” /><br />
    8. 8. Presentation Model:AddUserView.mxml<br />8<br />AddUserView.mxml<br /><s:TextInput text=“@{model.user.name}” /><br />
    9. 9. 9<br />Swiz<br />
    10. 10. Swiz Intro<br />Framework for Flex<br />Lightweight & flexible<br />Doesn’t enforce any design patterns, project layout or inheritance<br />Decoupled from your application code<br />10<br />
    11. 11. Swiz Features<br />Inversion of Control / Dependency Injection<br />[Inject]<br />Event handing and mediation<br />[Dispatcher], [Mediate]<br />Handling bean life cycle<br />[PostConstruct], [PreDestroy]<br />Simplifies remote service calls<br />ServiceHelper, MockDelegateHelper<br />Chaining API<br />EventChain, CommandChain<br />Custom Metadata Processors<br />[URLMapping], [MediateSignal], [Resource], [Logger], [Bind]<br />11<br />
    12. 12. Swiz Links<br />http://swizframework.org/<br />http://swizframework.jira.com/wiki/display/SWIZ/Home<br />12<br />
    13. 13. 13<br />Demo<br />
    14. 14. Full Class Diagram<br />14<br />
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×