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 / Public Demos, Tools and Applications / Just launched a driving game DEFEND THE DOME .COM on: August 28, 2009, 02:27:28
We just launched (18 minutes ago)

http://www.defendthedome.com

you get to drive an Ford F150 or Ford Flex from Flowery Branch to the georgia dome avoiding sofas, ladders, rocks and cars :)

It looks like flash, but is flash graphics with flex "doing the work", its all of course pureMVC, and uses the following :

  • pureMVC
  • fabrication
  • The finite state machine (FSM)
  • google's flash analytics swc
  • google code bulk loader (modfied to load fabrication modules)
  • clearspring for social networking
  • blood, sweat and tears :)

Its probably got some bugs, that we'll be fixing in due course.

Cheers
Grant Davies
http://www.bluetubeinteractive.com
2  PureMVC Manifold / Demos and Utils / Finite State Machine - FSM entering/exit notifications vs "system" notifications on: August 24, 2009, 11:16:57
I'm having a bit of a naming challenge with the FSM and its naming conventions.

Referring to the stopwatch demo

* When the FSM enters its STATE_READY,  the entering notification is RESET_DISPLAY - "resetDisplay"
* The command ResetDisplayCommand then call the proxy, proxy.resetTimer();
* The proxy updates the internal timer, and then sends the notification RESET -"StopWatchProxy/notes/reset"
* when this then picked up by ApplicationMediator, which gets the current elapsed time which the view is bound to.

The question I have, is both RESET_DISPLAY and RESET are notifications, but all the constants with "note" in the path ("notes/reset" are processed by commands, all the notifications without note ("reset") are processed by mediators.  There seems to be some sort of implied "domain" here, and I'm trying to keep my own app clean and following this convention.

I can see that by making the command process the state entering notification it can tell the proxy to update "data" and the proxy's notification then allows mediators to update the display as a result of business logic (by the command) and data changes (as a result of the proxy).

But if we had to "name" the notifications that the proxy is dispatching, what would we call them, since they ARE different from the notes that FSM is dispatching and the commands are registered for ?

Realisically whats the difference between the app mediators "reset" and the facades "notes/resetTimer"  seems like in a complex app this type of overlap is inevitable and could be very confusing since notifications are not for commands or mediators, they are consumed by anyone, so I'd see it very easy for someone to have their mediator listen for "notes/resetTimer" instead of just "reset" by accident on a larger team.

Is there some convention where "notes" from the FSM's entering/change/exit states would be named differently to the apps "view related" notes not just in the class they are defined in, but how they are defined ?


Cheers
Grant










3  Announcements and General Discussion / Fabrication / General practice for "daisy chained" notifications on: August 03, 2009, 10:46:16
Hey guys,

I'm looking for some guidance/best practice here, I seem to be running into a common pattern in the larger pureMVC apps we create ( >300 hours), and I don't like the "ad hoc" solution I seem to be using.

A simple example :

I have a shell application for a set of games, the user can choose which game to play, when various "events" in the app occur, a game may loose "focus", the games are implemented as fabrication modules so I'm dispatching events to modules using routeNotification, I have the shell manage focus as follows :

  • The shell captures focus when someone clicks on the main application
  • The shell knows which game is active through the ShellGameProxy
  • When the main view receives a mouse click, it dispatches a notification ShellConstants.SHELL_REQUEST_FOCUS
  • The FocusRequestCommand, receives this notification and looks at the ShellGameProxy to see which game is active, when it determines that, it routes a notification directly to that module using MODULE_REQUEST as the note name, and RESUME_FOCUS as the note type
  • The modules all have their own ModuleRequestCommand, it receives the MODULE REQUEST, and the switches on the RESUME FOCUS, it then re-dispatches so it can figure out what to do with as MODULE_RESUME_FOCUS, the ModuleFocus command, receives this and determines if the module should receive focus and if so sends a RESUME_FOCUS notificaiotn, the GamePlayMediator is listening for this and tells the main view to "take" focus.

The thing I don't like is I have the shell sending focus resume notifications that differ from the module's resume focus notifications so that the module's can process the request in a command to make a decisions rather than the notification going directly to the mediator and affecting the view without any "businesss logic"

But I feel like I'm daisy chaining notifications and changing their names just so that I can control "who" hears them, and it feels "messy".

shell gets focus -> shell sends focus to module -> modules receives request and figures out if it needs focus -> modules sends focus to its mediator which applies it to the view

I seem to have

SHELL_REQUEST_FOCUS as notificaiton
MODULE REQUEST with RESUME_FOCUS as type
GAME_RESUME_FOCUS as notification

This seems to occur a lot on large apps where some "action" requires a few decisions and information to be "passed around" before a final "do it" notification can be dispatched for a mediator to actually apply.


Any thoughts would be most welcome :) ???





4  Announcements and General Discussion / General Discussion / Multiple "dependencies" for state machine "change" on: July 12, 2009, 06:31:51
I've finally got round to looking at the FSM implementation and really like it for a project I'm game I'm working on that has has a lot of states.

couple of questions

1) can you have as many FSM's as you need ?  They are just separated by the states they are listening for ?  I would need a state manager for some game "overlays" like highscore, login, prizes and a different manager that manages where you are in the game, and they both run in parallel.

2) I load quite a few modules to run the game, one module has a game in it, another has the games videos and another has the games dialogs/overlays.  I can't be "ready" until these modules have loaded, it doesn't seem that the FSM is involved in this issue, i.e. it needs to know when an action takes place, but if I had 3 modules that had to be loaded before the the state RUNNING would be entered, it seems its up to me. The state could be INITIALIZING but after I've loaded 3 modules I could send the ACTION INTRODUCE_GAME and the new state would be INTRODUCING.  Is this "roughly" how it should be done ?  I've been trying to avoid some dependency mechanism for all my modules both being loaded and initialized, but looks like I need to suck it up :)

5  Announcements and General Discussion / Public Demos, Tools and Applications / Cheerwine brand website built with flex, flash and pureMVC on: July 08, 2009, 07:42:14
hey guys,

I meant to put this up a while ago, but we built the new cheerwine brand website using Flex, Flash, pureMVC, fabrication and modules.  Its a bit of a "pig" since the creative really wanted some crazy stuff that wasn't super optimized, but its looks good and is a lot of fun.  Make sure you click around and try and dicover the hidden items, like clicking on the beach and clicking the moon etc.

for the geek side we used

pureMVC
clearspring social networking
the google code bulk loader (which we hadded fabrication module loading support to)
swfAddress
Flash
Flex component toolkit for Flash
Flex
Tweelite library

and probably a bunch of other things I've forgotten :


http://www.itsasoftdrink.com

Cheers,
Grant


 
...........................................
› b l u e t u b e i n t e r a c t i v e
.: Rich Media Solutions :.
.: Flex, Flash, Air and Rich Internet Application Development :.
.: grant davies :.
.: 404.428.6839 (c) :.
.: 678 500 9147 (skype) :.
.: 404.921.9550 (f) :.
› grant@bluetubeinteractive.com
http://www.bluetubeinteractive.com
http://theresidentalien.typepad.com/ginormous [blog]


6  Announcements and General Discussion / General Discussion / Where to put some url parsing code - proxy or command ? on: January 15, 2009, 05:45:22
Hi guys,

I have a fairly sizable portal architecture built with pureMVC and I'm working on the deep linking section and trying to figure out "where" to put some logic.

I get a notification that the page has changed and I need to parse the url parameters and store them in a proxy and then determine if I need to go to a new "page" in the system or if some url parameters changed e.g. a new video needs to be loaded.

The parsing of the url parameters needs to involve two proxies since one proxy has the list of parameters that are valid and the other proxy stores a hashmap of the results.  It seems that this code could go in a command like a URLParameterParserCommand but that just seems "not quite right" to me, mediators are for managing views and proxies should do business logic, so I'm back to "should a command do it?".

the other thought is to add it to the proxy and have the proxy do the parsing since the command is doing the business logic that determines the parsing should be done.

any thoughts would be appreciated :)



Pages: [1]