Posts tagged ‘PureMVC’

MemberDatabase – AIR application (Flex/PureMVC)

This demo illustrates how you can use Flex, PureMVC and Adobe AIR local SQL database to create simple member management system. With the Member Database you can store unlimited number of members, sort any information in the database and export data to xml file.

Sample Files:
MemberDatabase.zip (ZIP, 647 KB)

Custom Pipe Messages

Strongly typed messages are used to communicate between cores in PureMVC MultiCore application with Pipes Utility. Below is a simple example of a custom pipe message class, and a JunctionMediator using the custom message. Message names are defined in the message itself which makes the message handling very easy.

ContactMessage.as

Make async call from Flex/PureMVC application

In this example I want to show you how to make asynchronous call to a web service from Flex/PureMVC application.
You can learn: how to call a web service from Proxy, convert returned xml into “smart VO’s”, notify the rest of the application about new data.

PureMVC StateMachine lockable door demo

I created and slightly modified Lockable Door application mentioned in StateMachine presentation by Cliff Hall. Application have 3 states OPENED, CLOSED and LOCKED, makes use of entry, exit guards and also sends CHANGED annoucement(notification) for specific(CLOSED) state. This demo is great for beginners learning PureMVC StateMachine Utility.

View demo, source code, fsm diagram

Transition between States in PureMVC StateMachine Utility

Below you can see what’s happening when transition between states occurs. First your application sends a StateMachine.ACTION Notification that triggers the StateMachine to begin a transition. Any state specific exiting or entering guard(Commands or Mediators)¬†defined for the current and target state are notified. If transition is not cancelled the current state is changed to the target state and any state specific CHANGED annoucement is sent. And finally a generic annoucement of the CHANGED is sent.

Continue reading ‘Transition between States in PureMVC StateMachine Utility’ »

Module to Module communication

This example is implemented using PureMVC and demonstrates how to load dynamically, connect and communicate Modules that have been implemented using the PureMVC framework.GreenModule communicates with BlueModule directly through pipe(no need for sending messages to Shell/Application and from Shell back to the Module). The same happens for BlueModule-GreenModule communication, messages are sent through pipe.

View and study Source Code
Live Demo

Connecting Module to Shell – simplified diagram

I had a hard time to understand Flex/PureMVC-Multicore version with Pipes utility especially when simple demos on the web use TeeSplit and Pipe to connect single module to application (diagram at the top-left). It didn’t really make sense to have TeeSplit for only one Pipe/Module. It makes more sense to add Tees(TeeSpit, TeeMerge) only when you go to the next level of having the application collaborate with multiple modules (diagram at the bottom).




Jump into code

PureMVC actors and their responsibilities

Model(Proxies) contains the data and business logic.
View(Mediators) presents the user interface components.
Controller(Commands) handles the user input and manipulates the model.

Read short description and examples

PureMVC in a week

I decided to take my flex development to the next level and learn PureMVC framework in a week.

I will be:
– studying framework documentation.
– reading blogs, tutorials and forum posts.
– learning from source codes.

See my bookmarks, notes etc.