PureMVC Architects Lounge

PureMVC Manifold => Demos and Utils => Topic started by: puremvc on August 16, 2009, 07:21:08



Title: Loadup as Ordered - A PureMVC AS3 / Flex Demo
Post by: puremvc 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


Title: Re: Loadup as Ordered - A PureMVC AS3 / Flex Demo
Post by: kouri 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  ???


Title: Re: Loadup as Ordered - A PureMVC AS3 / Flex Demo
Post by: Tekool 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).


Title: Re: Loadup as Ordered - A PureMVC AS3 / Flex Demo
Post by: kouri 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 ?


Title: Re: Loadup as Ordered - A PureMVC AS3 / Flex Demo
Post by: Tekool 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! ;)


Title: Re: Loadup as Ordered - A PureMVC AS3 / Flex Demo
Post by: kouri on November 05, 2009, 03:40:21
Thank's a lot !     ;)