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 / General Discussion / Notes being sent 1st are not being received 1st on: August 27, 2011, 06:15:46
I think I'm either going about PureMVC's notification system incorrectly or there is something that can be improved about the notification system.

The problem I am having is that a notification is sent out but during one of the mediator's reactions to this notification, a 2nd notification is send out, which is received by the other mediators before the other mediators receive the 1st notification.

For example,
1) Note1 is sent to the application.
2) Mediator1 and Mediator2 are set to receive Note1
3) Mediator1 receives Note1 first.
4) Mediator1 reacts to the note by sending out Note2
5) Mediator2 receives Note2 and changes a local boolean property from false to true
6) Mediator2 finally receives Note1.
7) Because the local property is true, Mediator2 reacts to Note1. If the local property had remained false, then Medaitor2 would not react to Note1.

I understand why Mediator2 received Note2 before it received Note1 even though Note1 was sent before Note2; however, I expected a different behavior. This is exactly the same kind of behavior as ActionScript's event system, but I would have expected the PureMVC to allow a different behavior. I would have wanted any notes to be placed in a Queue system. So if Note1 was sent, then Note1 should be received by all Mediators before any other notes even if a Mediator sends out a note while Note1 is still being sent out.

1) What is the workaround to this issue? How can I ensure that Mediator2 does not change a local property before it has a chance to receive Note1?
2) Is there a way to ensure all mediators receive Note1 before it receives any other notes?
3) If not, should the PureMVC be changed so notes are placed in a FIFO (First In First Out.) queue? As not to break previous PureMVC applications, should PureMVC be changed so a change of a property would make the notifications be sent either using the current logic or the FIFO logic?

2  Announcements and General Discussion / Architecture / Suggestion on how to send reports to Omniture? on: June 10, 2010, 07:16:25
I have a question on how to architect online reporting using puremvc.
For example, I'd like to report to Comscore and/or omniture.

Usually proxies are used when you're communicating to the outside world, right? So that would mean I would create a proxy(ies) to communicate to online reporting sources. Proxies do not hear any of the framework's notifications, so that would mean I would need to create a Mediator to listen to the notifications that I would like to report. Furthermore, mediators should not tell Proxies what to do directly, so that would mean I would need a command(s) to let the reporting proxy know what notification was just dispatched.

This seems like the framework is forcing me to create extra classes when it would be simpler if the proxy could listen to the framework's notifications and thus cut all the middlemen. Is this (see below) the best way to set up a reporting architecture, or is there a better way?

1) Framework dispatches notification
2) Reporting Mediator receives notification
3) Reporting Mediator dispatches notification thru a command
4) Command tells Reporting Proxy what notification was just dispatched
5) Reporting Proxy formats the proper parameters and sends info to the reporting agent: i.e. Omniture.

3  Announcements and General Discussion / General Discussion / Mediators talking to each other about their states on: April 16, 2010, 04:44:08
What's the best practice for one mediator to know about the state of another Mediator's view component.

Reading thru the forum thread, it would seem that I would need to send out a notification to request a value of a state of a view component, at which point another mediator would get the request and send a notification itself with the state value, and then finally the original mediator would get the desired value. But this seems like a round about away of getting a value. Plus, if I need to know the state of 2 or more different view components, then this process seems even more complicated that it really needs to be.

So would it be okay for the mediator to directly call a getter method of another mediator to get the value of the view component state - similar to how a mediator can directly communicate a proxy.

Or is there a better more centralized way of getting the states of the various view components? For example, perhaps a central class listens to the various state notifications from the view and keeps a record of these state changes. So when a mediator needs to know the state of a view component immediately, then it could call a getter method of this centralized class to get the value of the view component state.

Or is there some design pattern that I could utilize to achieve this?


4  Announcements and General Discussion / General Discussion / Update on the Open Source License? on: April 13, 2010, 04:06:26
Last year it was written in the FAQs that the MIT license was being considered instead of the CC license that is currently being used for the framework.

"I have come around to consider that perhaps another license would be better. This will most likely be the MIT license, which is simpler. However changing all the files in the project in one sweep will be a job. "

I checked around on the forum but could not see if there has been any updates on this subject. Is the MIT license still under consideration and in the current development roadmap?
5  Announcements and General Discussion / General Discussion / A mediator for every display item? on: April 12, 2010, 12:51:09
It is best practice to create a Mediator for every display item/button?

For example, let's say I am creating a music player. Should I create a mediator for the play button, another one for the progress/scrubber bar, another one for the volume button, and so on?
6  Announcements and General Discussion / General Discussion / Should a Command add an event listener? on: April 09, 2010, 09:33:50
I'm new to PureMVC, so i want to double check if what I am planning on doing is considered best practice or if there is a better way.

I have a Startup Command that registers a proxy. The proxy takes awhile to get its info, which is needed to start the application. In the meantime, nothing can be done until this info is returned, so there are no other proxies, mediators, etc. Currently, I have the startup Command add an event listener to the proxy and wait until the proxy indicates that the info has been returned. When the info is returned, then  the startup command registers the rest of the start up proxies and mediators that use this initial data.

The startup command is only called once.

Is this an okay practice? Is there a better way to go about this?
7  Announcements and General Discussion / General Discussion / Facade listen to Notifications? on: March 31, 2010, 09:46:03
How can I get my facade instance directly to listen to a notification?
8  Announcements and General Discussion / General Discussion / Walk Through of the StateMachine? on: March 30, 2010, 10:02:50
Does anyone know if there is a walk through on how to implement the StateMachine into your PureMVC framework? The "StopWatch" demo doesn't count as it simply allows you to download the source code. What I'm looking for is a step-by-step description of how to insert the StateMachine code into a PureMVC implementation.

9  Announcements and General Discussion / General Discussion / AS3 livedocs documentation? on: December 10, 2009, 10:36:44
Is there a page on this or another site where the framework's classes are documented in ASDoc or Adobe livedocs style?

For example:
Pages: [1]