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 / Mediators / Notification and System Memory AS3 Flash on: March 03, 2009, 02:17:36
Sup Pure MVC'ers,
So basically I need some help, as we all do ;) and I suspect there is more of a question for Cliff than anyone.

What I have is a base mediator( responsible for any tweening, adding and removing itself from the stage ).
BaseMediator is extended by SpriteMediator( sprite mediator is responsible for for any graphics, solid fills, les's, boxes, lines..... ) then I have ImageMediator( you guessed it, responsible for for loading and masking images.... ).

Any new modules I need to make extend mediators - ImageMediator / SoundMediator / MovieMediator, whatever. So all I have to do is call my new module Mediator and the notification trickles down using a switch case command with super.handleNotification( note ) in the default, which I thought was pretty cool - however when I checked the system memory each time a note is passed to its parent the system memory increases by 4k. Which I know is not much, but through 4 different mediators and then to a command to load an image is 20k, plus the system has listener events called on resize, keyboard..... all mounting up.

Basic debocal, when I load a background image the memory usage was going up 2-3megs when the image is 200k. So after this long winded - whats going on, my question is this does the mvc system garbage collect the notification objects that is sent to mediators and commands and if not, how would you suggest implimenting this feature???


Cheers
~D
2  Announcements and General Discussion / Architecture / Mediator Extension on: October 08, 2008, 06:48:27
Hi Guys,
I have a quick question and hope that someone can point in the right direction.

Flash/AS3 standard core version, no fancy flex or anything.
I basically want to create a set of base mediators, which contain certain listNotificationInterests and the corresponding handleNotification's, these base mediators have common notifications throughout such as adding its component to the stage, using tweener to move it round, so on......

Then build all custom mediators out this set, that way if I want to extend anything I just extend the base mediator and everything using it has the new functionality.

Problem I ran into was that Mediator sets up abstract public classes listNotificationInterests and handleNotification to be over-ridden by custom mediators, I didn't really want to start playing round with the frame work, I wanted the custom mediator to extend the base - not override them......
Please forgive any ignorance - as I'm sure there is already a way - i just can't follow at the mo.....
Should I be using a controller to setup and pass the notifications array to the mediator?
Has anyone done something like this?
Is there a better way?


Chur
~D
3  Announcements and General Discussion / Architecture / MEDIATOR MADNESS - sale on now!!! do they really have to go? on: July 01, 2008, 04:17:55
sup sup,
I have created my first flash based website in pureMVC, firstly i'd like to thank Cliff and everyone else that has helped me along the way - shot fellas.

I am in the process of refining things - basically I want to optimise the sh@t out of it!
I'm about to start playing with the wonderful bitmap and BitmapData classes in flash cs3 so I only ever have to load in one image and clone it across multiple pages if it needs resizing blah blah blah.....
Anyway I digress, at the moment the application I have made creates bucket loads of mediators, only ever once, but never the less they are always present and just added to the stage when needed - each time you go to a new page it has new mediators, we are looking at anywhere from 15 - 40 mediators per page depending on the amount of images present in that page.
So the first page may have 20, the next page may have 25 - so when you go to the third page you already have 45 mediators then the next pages mediators.......

I know in the last one I posted, Cliff said there was no ceiling except for the processor on the computer, but am I pushing it with this amount?
So my question is by me being lazy and not getting rid of the last pages mediators so I don't have to create them again bad?
If a mediator is created on previous page but not used on the current does it slow down the whole app?


Please tell me I can be lazy.....
Cheers
~D
4  Announcements and General Discussion / Architecture / Trouble with view components - mad stuck on: June 12, 2008, 07:36:16
Hi Guys,
Hope all is well within the land of MVC, having lots of fun with a website I am making in flash using pureMVC framework at the moment :)

I am however having a little bit of trouble with a revolving image box I made in pureMVC.
Essentially I am just reading in a XML file which has a list of images, a mediator is created for every image, that image get loaded into the view component automatically in the constructor, and all of these mediators are linked to master mediator.

The master mediator controls the fading in and out event, tells which mediator to do what - which in turn controls the view component of the image.

Everything is cool, and this seems to work fine - unless we add more than 20 images to the list.......
20 seems to be the magic number I do not understand why?

I thought that perhaps it maybe because all the images are automatically loaded in, the mediators are created one after the other, leaving only a couple of Millie seconds between each mediator / image load that this may cause some issues?

Would this be the case?
Can you suggest a better way for a noob to go about this?


Cheers
~D
5  Announcements and General Discussion / Architecture / Dynamic Mediators and Notifications on: April 21, 2008, 03:18:01
Kia Ora,
Firstly I'd like to say well done to Keith its a nice scaleble framework.

This is my first attempt at MVC and Flash AS3 Framework, I am creating menu structures and stage layouts dynamically dependent on the page that is read in, all my Mediators and Components are created dynamically from recursive simple and macro commands.

What I am finding though is that because I am creating them all dynamically, when sending a notification to the menu for example I am having to have all my mediators receive the notification and react only if their mediator name is the same as that which is sent in the notification......

Although this works, the result is complicated code that is not very easy to follow, I also think that its a little too dependent on each other and not as loosely coupled as it could be - i'm sure if a came back in a month I'd have trouble following it!

Does anyone have an example where they have used dynamic mediators in a different way?????


Cheers
~D



Pages: [1]