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]
1  Announcements and General Discussion / Architecture / Re: Structural Advice and Un-registering Mediators. on: August 06, 2008, 12:40:33
Cliff, thanks for the reply.

I suppose I should have added the disclaimer that I'm not working in Flex so I don't have IDs for my windows "out of the box" so to speak.  I suppose I'll implement this and assign IDs to windows when they're created and use your suggestion of using this value for the mediator.  Of course if I had multiple windows going at once that had the same IDs, could there be name collisions (when removing or registering)?

Finally, thanks for all your work on the framework and your ongoing support here :)
2  Announcements and General Discussion / Architecture / Structural Advice and Un-registering Mediators. on: August 05, 2008, 04:02:50
Hi, let me prefix all of this by saying that I'm very new to using the framework but I quite like the way it works.  I'm having a bit of trouble deciding how to go about implementing something and so I'm looking for some advice.  I'm also wondering about managing references to mediators for later cleanup.  Here's where I'm at...

I'm building an application where I've got a layer that displays information windows as an overlay over the whole app (like loading progress bars, etc).  I've built a mediator for the overlay container (just a Sprite) which listens for NEW_INFO_WINDOW notifications and builds a new view in the container and then sends a notification REGISTER_INFO_WINDOW with the new view as the notification body.  I have a command mapped to trigger on REGISTER_INFO_WINDOW that creates a new mediator for the view passed along (InfoWindowMediator).

First of all, is this a good way to do things?  Some of my information windows will be non-interactive so I wonder if there's even a point to registering a mediator for them.  However, some will be interactive like confirmation dialogs.

Secondly, this is going to, over the course of the applications life, create a large number of InfoWindowMediators.  I really don't like having orphaned objects that won't get garbage collected so I've been struggling with a way to keep account of the mediators and un-register them when the information window they mediate is destroyed and removed.  Any suggestions there?

I hope that all makes sense.  Thanks in advance!
Pages: [1]