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

Pages: [1]
Print
Author Topic: Loadup as Ordered - A PureMVC AS3 / Flex Demo  (Read 15200 times)
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« on: August 16, 2009, 07:21:08 »

This demo illustrates the use of the PureMVC framework, the Loadup Utility, and the Asynchronous Stub utility to orchestrate an ordered startup process, where Model resources must be loaded in a specific order.

The demo has historically been located here: http://trac.puremvc.org/Demo_AS3_Flex_LoadupAsOrdered
The project has been moved here: https://github.com/PureMVC/puremvc-as3-demo-flex-loadupasordered/wiki

The author is Philip Sexton.

NOTE: This project is now known as LoadupAsOrdered, and was renamed when StartupManager was renamed Loadup, to dispel the notion that the utility it was only usable at startup time.

The previous thread is here: http://forums.puremvc.org/index.php?topic=258.0
« Last Edit: September 23, 2012, 09:45:48 by puremvc » Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #1 on: November 05, 2009, 09:56:59 »

Running the LoadupAsOrdered demo, the loading finishes "incomplete". What does this means ?

In the case of LoadupForAssets demo, I can understand a loading failure  (targeting unobtainable or corrupted assets) but for internals resources, I really don't understand  ???
« Last Edit: November 05, 2009, 01:27:43 by kouri » Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #2 on: November 05, 2009, 11:18:18 »

Hi Kouri,

>Running the LoadupAsOrdered demo, the loading finishes "incomplete". What does this means ?

It is something wanted by Philip to demonstrate how the application react when there is failures. Look at the code, you will see that random implicit failures are introduced in each resource proxy. Use the "try to complete" button more than one time to complete the load. In a real application you can use a TryToCompleteCommand that will do the same thing as the button does if the whole loading fail and repeat it as many time you want once the loading succeed (or definitively not).

> I can understand a loading failure [...] but for internals resources, I really don't understand

Those proxies aren't intended to simulate internal resources. Each proxy use an AsyncStubProxy to simulate async loading of an external resource (even if it don't do this for real). This means that each of the data controlled by each proxy could came from an external file in or be called from a server or whatever you want in your real application. You don't need to use the Loadup utility on proxies that do not need to load data (internal resources).
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #3 on: November 05, 2009, 01:27:21 »

Tek,

Thank's for your explanations. I think I understand now a little better the aim of this demo (to me,  "simulator"  would be a better word)

So If I want to load somes xml files in an ordered way (like configuration and localisation in AppSkeleton demo, for example) I should get rid of these dummy files (InvoiceProxy, EntityProxy, ProductProxy...). and set up proxies with proper load() result() and fault() methods. Am I right ?
« Last Edit: November 05, 2009, 01:30:44 by kouri » Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #4 on: November 05, 2009, 01:52:34 »

To be exact, each proxy only have to implements ILoadupProxy interface, so you'll only have to expose a load() public method. But finally, yes, you will set up each proxy with result()/fault() private methods or equivalents, depending on the utility you use to load you're data in your proxy.

Hope this will work for you now! ;)
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #5 on: November 05, 2009, 03:40:21 »

Thank's a lot !     ;)
Logged
Pages: [1]
Print