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: MEDIATOR MADNESS - sale on now!!! do they really have to go?  (Read 6852 times)
Dal
Jr. Member
**
Posts: 16


View Profile Email
« 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
« Last Edit: July 01, 2008, 04:53:09 by Dal » Logged
creynders
Jr. Member
**
Posts: 18


View Profile Email
« Reply #1 on: July 02, 2008, 07:47:27 »

When navigating from one page to another clean up the mediators you don't need anymore. Which is best practice BTW.
So yes, in this case, being lazy is bad.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: July 02, 2008, 09:47:21 »

It might be time to ask yourself if you need all these mediators.

Can the view component that the image is a part of not be the thing that is connected to a mediator? Have it expose methods for setting and getting the images, and send events that say 'something just happened to image 42' rather than image 42 sending that message to its own mediator?

Sounds like you've just got the granulaity knob cranked too far to the right. :)

-=Cliff>
Logged
Pages: [1]
Print