Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought

Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1] 2
1  PureMVC Manifold / Demos and Utils / Re: StateMachine - A PureMVC / AS3 Utility on: May 06, 2009, 06:50:20
Cheers guys, I really like this utility and the new logic you have implemented was exactly what I was looking for in a demo I was putting together.  So I have integrated the new code as detailed above in the following post:

Combining the PureMVC StateMachine Utility with Slacker http://cli.gs/pSUVae



[ Twitter ] @newtriks
[ Blog ] http://www.nutrixinteractive.com/blog/ 
2  Announcements and General Discussion / Architecture / Re: Complex (Nested) VOs on: March 05, 2009, 04:02:08

2 fairly straight forward suggestions would be:

1) onRegister of Data1Proxy send for your XML, when that is successfully received send a notification which runs the RemoteRequestCommand to make Data2Proxy send your remote request.  When you then have your remote results store them in Data2Proxy as typed objects in an ArrayCollection (I presume your mp3 links and data etc).  I am unsure why you need Data3Proxy?


2) Set up a checklist proxy which tracks the progress of your startup?


3  PureMVC Manifold / MultiCore Version / Handling PopUps on: February 08, 2009, 09:02:41

I have recently updated some of my logic to handling popups in PureMVC and have posted the information on my blog:




[ Website ] www.newtriks.com
[ Blog ] www.nutrixinteractive.com/blog/
4  PureMVC Manifold / Standard Version / Re: Open a popup form by MainViewMediator ? is it the good way ? on: February 08, 2009, 08:58:05
Here is an update to that logic:

5  PureMVC Manifold / Standard Version / Re: Remote Objects on: February 08, 2009, 07:57:00
Here is an example of this exact scenario, ensure you check the Manifold as a lot of the queries made are uploaded already there answering your question.

6  Announcements and General Discussion / Architecture / Re: Help with Commands on: February 08, 2009, 07:29:10
Hey Jesse,

I have heard this asked a lot of times and as a foreword I would like to say that this is my opinion and I am not the best at debating points to the finest detail, this is just how I interpret the whole command issue.  Also you have way way more experience with many different frameworks compared to myself so logic may differ?

I think the beauty of PureMVC is the way you can essentially utilise it to 'what suits you' to a degree, over time I have pushed out a lot of PureMVC projects and still adapt and change certain styles and techniques with certain logic, this I don't think is necessarily a negative and see most changes I make a positive progression.

In the beginning I took much the same principle as you mention below, using commands to essentially prep the model and view, check for mediator registration etc.  I am an advocate for referencing Proxies in the Mediators if it is to simply get some data, a reach in and grab situation.

Then Stef (www.flashcomguru.com) and I had some chats about this whole scenario and each time we spoke I found I was tending to handle more aspects within a Command and was removing certain logic from the Mediators and Proxies.  This then started solving a few issues I was having, primarily bloated Mediators and referencing the odd proxy within another proxy  :o

With my latest application it is one of the biggest I have built so far and I will use some of this project as examples into my logic.  There are lots of collation of data from the UI and processing of data received from remoting calls.   

Mediators I try to keep them simple, grab data from the views, dispatch it and stuff it right back in again, I also handle form/view resets, determine whether certain components within the view are selected/enabled and dispatch notifications to change view state etc.

Due to numerous Proxies for various remoting calls, I am receiving back data which needs to be amalgamated, filtered and ultimately stored.  This is where I have now really shifted logic to Commands.  Heres a really rough example. 

A booking engine has been sent a request for journeys and fares to populate a grid dependent on user defined journey times.  I would have 2 proxies. 

-The first has all the fares applicable to the search request times, each fare has a code used as a reference to retrieve further current info on that specific fare. 
-The second proxy loads the current fare information and using getter methods passes back the extra fare information dependent on the fare code. 

So I now need to filter these fares on certain current fare data and instead of having all this logic in one proxy (don't forget its using logic from 2 proxies) I use a Command.  The first proxy receives the fares, sends a notification, a filter command which references both Proxies then filters all the fares and returns the new array collection into the first proxy for storage.

Here's another example.  I have various TitleWindow popups which are presented in different formats i.e. Image/Text, Forms etc.  I have a PopManager utility which accepts the popup params including a reference to the Facade.  Anywhere in the application I can now call and open a popup i.e.
sendNotification( ApplicationFacade.HANDLE_POP, pObj, ResourceConstants.OPEN_POP ); and a HandlePopCommand will handle the logic of opening the correct style popup window (also closing it).  To do that I simply use switch statements on the body and type of the notification and the command then checks to see if the pops mediator is registered and then opens (creates) or closes the popup accordingly.

Here's one more example.  I have multiple view components which need to have all their data collated into one value object and then sent to a proxy for a remote request.  A command has references to the specific mediators and calls the mediators getter method bringing in all the view data, populating the value object and filtering the data according to the data it is receiving.  This prevents the Model receiving the data via multiple notifications and ensure an order to how the value object is populated.

On a final note, I do have a lot of commands on the slimmer bordering anorexic side which simply call different methods in a proxy dependent on the notification type i.e. if note.type() == reset a password, or reset a username etc.  I then go though the various proxy method calling from there, this could be done in the Proxy, but I am now more comfortable with the Commands handling this logic and cutting back on the proxy code.  Following the theme of logins, there maybe different proxies handling different accounts so one command to handle this logic and call the appropriate proxy is ideal for me.

Ok, that's my thoughts on this, hope that helps in some way?



[ Website ] www.newtriks.com
[ Blog ] www.nutrixinteractive.com/blog/
7  PureMVC Manifold / MultiCore Version / Re: Pipes Utility - Disconnecting Pipes on: August 04, 2008, 03:33:10
Hi all,

I have been spending some time trying to delve into Garbage Collection for effective loading and unloading of modules within a MultiCore application and have achieved some good results.  I have made a blog post regarding my results and also build a demo application to help people further grasp techniques I have used:




8  Announcements and General Discussion / Getting Started / Re: Tutorial for Flash CS3 on: January 19, 2008, 03:19:17
And here is another way to tackle PureMVC and CS3:

9  Announcements and General Discussion / Getting Started / Tutorial for Flash CS3 on: January 11, 2008, 11:37:58

How to Build a Simple FLV Player in Flash and Flex using the PureMVC Framework.

I have seen quite a few comments on the web regarding getting started with Flash CS3 and PuremMVC so here is a simple step by step guide to getting up and running. 

Thanks to Pedr Browne for insight to the document class :)
10  Announcements and General Discussion / Public Demos, Tools and Applications / New Flex, ColdFusion and PureMVC tutorial on: November 23, 2007, 07:50:11
Please have a look at the following post http://www.nutrixinteractive.com/blog/?p=73.  It is details of a new tutorial I have written for a publication over here in the UK (available for purchase online though).  It covers building a simple Flex application retrieving and sending data to a MySQL database.  The application is built on the PureMVC framework and give a really good insight into using PureMVC with Flex and ColdFusion for an application easily adapted for a real world scenario!


11  Announcements and General Discussion / Public Demos, Tools and Applications / Re: Flex & ColdFusion PureMVC style! on: November 23, 2007, 07:42:38
No probs man and glad it all worked for you  ;) pls checkout the my blog post, I have just written a tutorial Flex, ColdFusion and PureMVC, a few changes were made and it is now running super slick http://www.nutrixinteractive.com/blog/?p=73
12  Announcements and General Discussion / Architecture / Flash and Puremvc on: October 15, 2007, 03:59:51

Yet another quick one :) Going by your HelloFlash demo Cliff how would you call a function in the main fla frame 1 actions from a class in the framwork?
13  Announcements and General Discussion / Architecture / Re: ExternalInterface on: October 14, 2007, 01:26:42
As always mate thanks very much.  I much prefer working in Flex now I have decided, I know it equally has its problems but its surprising how much I have warmed to it over time and also how well I found your framework assisted my application development. 

Regarding the testing, I had tested it and had used (but took out for a small snippet of the code here) ExternalInterface.available == true.  Your advise is good man thanks :)
14  Announcements and General Discussion / Architecture / Re: ExternalInterface on: October 14, 2007, 08:09:59
package com.newtriks.model
import org.puremvc.interfaces.IProxy;
import org.puremvc.patterns.proxy.Proxy;
import org.puremvc.interfaces.INotification;

import flash.net.*;
import flash.events.*;
             import flash.external.*;

import com.newtriks.ApplicationFacade;
import com.newtriks.model.vo.ClipVO;

public class PlaylistProxy extends Proxy implements IProxy
public static const NAME:String = 'PlaylistProxy';

public function PlaylistProxy()
super( NAME, new String );

ExternalInterface.addCallback("getData", gotData);

private function gotData( returnValue:String ):void
data = returnValue;

public function get theList():String
return data as String ;


I am applying the puremvc framework to a Flash CS3 project for a change and there are definate obstacles after lots of Flex usage. 

One other area you I am sure can help is with this issue:  interacting with movieclips on the stage.  I have a StageMediator but am having trouble referencing items already on the stage?

stage.addEventListener( MouseEvent.CLICK, onStageClick );

works fine!

stage.myButton.addEventListener( MouseEvent.CLICK, onButtonClick );
? access of undefined property ?

P.S. I have been hammering away non stop for 3 days now day and night so simple things have got stupid???
15  Announcements and General Discussion / Architecture / ExternalInterface on: October 14, 2007, 06:43:04

Having trouble with ExternalInterface.addCallback(); in my Proxy, i.e. retrieving the data, the call back method doesn't seem to run in the proxy and hints?


Pages: [1] 2