Presentation Model pattern with Flex and Swiz framework
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Presentation Model pattern with Flex and Swiz framework

  • 3,534 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
3,534
On Slideshare
3,534
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
29
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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

Transcript

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