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 ... 3 4 [5] 6 7
Print
Author Topic: Loadup (formerly StartupManager) - A PureMVC AS3 Utility  (Read 72823 times)
meekgeek
Full Member
***
Posts: 25


View Profile Email
« Reply #60 on: June 13, 2008, 11:09:10 »

perhaps a little elaboration on why you don't think startup manager is right for the job

Maybe it's just the way I've grown to use it.  For me, it's the step before I setup my view, and there on end, call it when ever the view changes something in the model.

The utility that I'm proposing gives you the ability to load more "viewComponents."  You would have the ability to start and stop a load, load multipy files. Maybe even have it be aware of what type of file it's loading.  Factory pattern comes to mind... something with keys so you can refrence an image by name, if it finds it return Bitmap, if not load and return.

And just to simplify things, have startupmanager be a utility used for the model layer, and this new one for the view. 

If you disagree, let me know why.  I want to learn...

Mold me Cliff  ;D  into a mvc genius like you
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #61 on: June 13, 2008, 02:36:43 »

The biggest reason I would lobby for extending StartupManager is all the loading stuff could be handled by one contraption and not two. It doesn't seem much of a stretch.

I am just asking whether there is some basic conceptual incompatibilty with StartupManager or if there is a way to extend it gracefully to handle the assets for the view.

anybody else out there have feelings about this? Chime in now! :)

-=Cliff> 
Logged
meekgeek
Full Member
***
Posts: 25


View Profile Email
« Reply #62 on: June 16, 2008, 10:00:40 »

I guess I'll experiment with both routes :)
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #63 on: June 16, 2008, 10:12:02 »

The startup manager (sm) , as use of it has evolved, can be used at any time, not just at startup, and is not necessarily particular to the model layer.  The internals have nothing specific to the model layer, it seems to me.

The choice of resource type arises within the client app, with the app's proxy, which must implement IStartupProxy and that is simply a load method.  This is the area which could be analysed so that common requirements could be bundled into a separate utility, which would in turn use the sm utility, or could be met by an enhanced sm utility if that made sense.  If this is the area that needs attention, it seems a shame to discount use of the sm as a body of core fucntionality.

You would have the ability to start and stop a load, load multipy files. Maybe even have it be aware of what type of file it's loading.  Factory pattern comes to mind... something with keys so you can refrence an image by name, if it finds it return Bitmap, if not load and return.

Taking the above quoted points, and interpreting them as logically inside or outside the existing sm
- start and stop a load: outside, local to the client app proxy; is it critical that the overall monitor be able to do this?  what is the example case?
- multiple files: inside, existing sm functionality
- be aware of file type: outside, local to the app proxy; again does the overall monitor need this awareness?
- factory pattern...if it finds...if not...: outside, local to the app proxy, the load method can have this lookup logic and can send a loaded notification if the resource is already loaded.

I think we need greater detail on the example case, so that we can see where the sm is deficient - is it in the core functionality or is it in the peripheral functionality?

----Philip
Logged
meekgeek
Full Member
***
Posts: 25


View Profile Email
« Reply #64 on: June 16, 2008, 09:15:18 »

I'm probably just speaking for myself. My needs might be very unique but perhaps your right and I might be able to use StartupManager.

start and stop a load: outside, local to the client app proxy; is it critical that the overall monitor be able to do this?  what is the example case?

Lets say I'm trying to load two files of similar size that will take 20 seconds to complete.  The current manager will take the percentage to 50% at 10 seconds and then go to 100% at 20.  Seems two long a wait for no action to take place.  That's why a contentmanager that can initialize to calculate the totatlbytes of the two files and then give you an accurate percentage rate before you actually start loading is crucial for sites that need to load a video or swf of that caliber.

As far as the rest of it goes, you're right...

Although, I am going to try something new with what i'm experimenting with right now.  The manager I'm building has a public load method that accepts a request object which contain a callback function and a list of assets to load.  Once loaded I'm going to try and send back an object with a keys tied to the asset it loaded.  for example:

:
key = "my.jpg"
object[key] = bitmap

Hope I'm making sense.  Anyway.  I'll see how this works for me and once done, I'll see if I can do the same with the current StartupMonitor.  If I can live with just using the StartupMonitor I'll post my findings.
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #65 on: June 17, 2008, 04:21:33 »

For what it's worth, here are my thoughts regarding the file sizes requirement, if trying to extend the startup manager
- the sendProgressNotification() method, should be protected access rather than private, to enable override [ should have been protected access anyway!!!  :( ]
- StartupResourceProxy to have new properties such as 'number of bytes' and 'load rate'
- ResourceList (IResourceList) to have getters for such as 'expected total number of bytes to be loaded', 'number of bytes loaded', 'average load rate', 'load start time', 'expected load completion time'
- then sendProgressNotification() might be able to send the required progress information
- time-based sending of the progress notification, as well as on completion of each resource load.

Better still, encapsulate all the progress percentage calculation within ResourceList, with a single getter 'percentage complete' that sendProgressNotification() can use.
----Philip
« Last Edit: June 17, 2008, 04:38:36 by philipSe » Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #66 on: July 20, 2008, 07:45:36 »

StartupManager MultiCore ...
For the startup manager utility, in the bin folder under trunk in the svn repository, there are 2 swcs, one for standard and one for multicore, the latter being named Utility_AS3_MultiCore_StartupManager_1_3.swc.
----Philip
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #67 on: September 06, 2008, 01:41:47 »

StartupManager Version 1.4 is tagged and available now. See the release notes for more info:
http://trac.puremvc.org/Utility_AS3_StartupManager/wiki/ReleaseNotes

-=Cliff>
Logged
marek
Jr. Member
**
Posts: 14



View Profile WWW Email
« Reply #68 on: September 26, 2008, 04:35:45 »

I tried to use StartupManager with swc files downloaded directly from SVN. Works fine. However if I'm using it with original source code included into packages got a problem with:
:
_monitor.defaultTimeout = 30; - sets in StartupCommand from example
:
StartupMonitorProxy.LOAD_RESOURCES_REJECTED - from StageMediator

Could you guys please check final 1.4 tag on SVN and just make sure that AS3 code = .swc files?
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #69 on: September 29, 2008, 03:05:38 »

StartupManager (SM) utility does not have a StartupCommand and does not have a mediator.

Maybe you are referring to the StartupAsOrdered demo.  StartupAsOrdered needs to be version 1.5 to be compatible with SM version 1.3 or later.  The code fragments you quote look like they're from an old version of StartupAsOrdered.

Hope this helps.
----Philip
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #70 on: October 21, 2008, 02:51:04 »

With reference to the assetloader feature of StartupManager, the question of urls ending with .css arose on  the StartupForAssets thread.  In order to ensure the maximum possible feedback on this, I am asking the general question here, this being the appropriate place anyway.

The currently supported set of types in the AssetFactory urlToType method, based on url name endings, are
- image type: .jpg, .gif, .png
- text type: .txt, .xml
- swf type: .swf

Apart from including .css as a text type, what other types should I include?

Also, do people think it would be better to have the logic default to text type when the ending is unrecognised, as opposed to the current approach which is to throw an error?

----Philip

Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #71 on: October 29, 2008, 10:02:24 »

So I've been trying to be diligent in my app and clean up any unused Proxy's and Mediators and noticed that, despite removing a couple Proxy's that were used with StartupManager, I have a bunch of NAMEProxySR's still being referenced in my Facade.model.proxyMap. Does StartupManager not cleanup these files after it completes? I can clean them up myself but was wondering if there's a reason for leaving these references after the start-up utility has finished and is no longer needed?
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #72 on: October 30, 2008, 03:41:05 »

@jasonmac
Some points by way of reply...
1. In general, I take your point; I'm sure the SM could do better in this regard; I will review it for the next release; any specific suggestions are welcome

2. Where the client app creates and registers a proxy, then it seems reasonable that the app is responsible for cleaning it up; but the SM should ensure it is not retaining references that prevent the gc from doing its job

3. Currently, use of the StartupMonitorProxy reset() method, does go some way towards removing references that relate to the previous session; you could use this even if you are not going to re-use the SM; you could even instantiate a new StartupMonitorProxy as a way of losing previous references

4. On loading complete, it could be argued that SM state still needs to be retained, in case the client app want to interrogate it; so probably we need a new method call by which the app can tell the SM to clear its state.

----Philip
Logged
Jason MacDonald
Sr. Member
****
Posts: 243


View Profile Email
« Reply #73 on: October 30, 2008, 06:00:25 »

Thanks for the reply philip. I ened up adding a simple public function to StartupMonitorProxy called Cleanup();

:
public function cleanup():void {
     if(!loadingActive) {
         for each(var resource:StartupResourceProxy in loadedResources) {
facade.removeProxy(resource.getProxyName());
         }
         // might want to add cleaning of failed files? Though apps usually won't load if things failed
    }
}

I didn't mean to imply there was anything wrong with leaving it up to the developer to clean up these files, but was more curious if there was a reason they needed to be left in. THanks again for your great utility!
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #74 on: October 30, 2008, 07:43:58 »

Jason, thanks for sharing your cleanup() code.  I'll do something on this in the next release.
----Philip 
Logged
Pages: 1 ... 3 4 [5] 6 7
Print