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: Command vs. Notification on: April 26, 2010, 02:31:01
i never let mediators react to notifications on their own, because it gets a nightmare to keep up with. with bigger projects, esp. with more than 1 developer it gets impossible to know what certain notifications do if they are not clearly mapped to commands.

or is there anything i am missing about how to keep track of those notification-interests/vs. commands-called ?

i really like the idea of going with the "less code" answer, but i dont think that would work for big/multi-dev projects?
2  PureMVC Manifold / Demos and Utils / Re: HelloFlash - A PureMVC AS3 / Flash Demo on: October 13, 2008, 04:13:53
Hi,

i want to create a deck of cards, the helloFlash application is often refered to when it comes to dynamic use of multiple proxies/mediators.

but while looking at it i feel that it breaks some of the rules of mvc...

1. the component helloSprite.as hold a lot of information like xpos, color etc. shouldnt a proxy hold these? or at least the mediator?
2. the component has a timer event and listener -> that should be in the proxy too. the proxy would then notify the mediator that the position has changed, and the mediator would cahnge its components position...
3. component listens for mouseEvents -> mediator should do that


it really confuses me to see that application as an example of best practices when it comes to dynamic mediators...

what should i do?

thanks for the help!
-tehk
3  Announcements and General Discussion / Getting Started / Re: Making a Flash Game using PureMVC on: July 14, 2008, 07:03:51
thanks for the insights!


so the model/proxy is only used when the information is used by lots of other classes?
(but wouldnt that be the case in the example with the hitTesting sprites??)


thanks again for sharing the framework and your knowledge with the community!
4  Announcements and General Discussion / Getting Started / Re: Making a Flash Game using PureMVC on: July 14, 2008, 11:53:56
hi everyone!

im thinking about creating a game too.

my question is related to this suggestion by cliff:

...

So, each sprite mediator, upon hearing the TIMER_TICK notification sent by the TimeProxy, advances its sprite and then sends a SPRITE_MOVED notification, with the sprite in question as the body.

All interested sprite mediators, handle the SPRITE_MOVED notification by doing a hitTest call on their sprite to see if there is a collision. ( (mySpriteInstance.hitTest(notification.getBody() as MySprite) )
...


i would have thought that the sprite mediators hear the TIMER_TICK notification, move the sprite, and then modify the model/proxy that is storing the position of the sprite. the proxy sends the notification SPRITE_MOVED, and then the mediators check for a hit?

how do you guys decide when to use a proxy and when to handle things in a mediator (i would do latter when needing a pure animation, that doesnt influence a proxy )



another question:
...
Then its a rock / paper scissors game. If its a tank who's just heard that an anti-tank missile has collided with it, then the TankMediator instance will remove the event listeners from its view component, set the viewComponent property to null, and then call facade.removeMediator(this.getMediatorName()), freeing up the memory from the tank sprite and its mediator for the GC.
...

when there are many instances of a mediator, wouldnt this.getMediatorName fail??


thanks for reading,
tehk
Pages: [1]