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 / Re: normalizing remoteObjects on: April 22, 2008, 12:14:04
... and that's why you make the big bucks.

I think I went with the command route because I thought proxys were not allowed to use other proxys.  (I think i came to that conclusion by looking at the conceptual diagram).

I already have the getAuthorById method on my authorProxy so the refactor will be easy.  I'll read the best practices doc again seeing as how 90% of my commands are model integrity related.

I knew you would have a simple, elegant solution.
Thanks a bunch.
2  Announcements and General Discussion / General Discussion / normalizing remoteObjects on: April 22, 2008, 10:11:08
this isnt 100% puremvc related, but I was wondering how people here handled this.


1) load a list of Authors and store them in authorList:ArrayCollection
2) Load a list of Books and store them in books:ArrayCollection

now, lets assume a book object is composed of an author object.
The author objects that the books refer to, are different instances than the authors in authorList.  The reasoning makes sense, the framework has no idea it has received that Author object before via a completely different proxy, so it just creates a new one. This breaks when a user modifies an author via a book, then goes to look at the list of authors, only to find their changes weren't applied to that list!

I am currently registering the RECEIVED_BOOK_LIST notification to a command class (NormalizeAuthorsCommand) that loops through the list it just received, finds the correct Author object from the authorList, and replaces the reference in the Book.  Once this is done, the command fires off a LOAD_BOOK_LIST_SUCCESSFUL.  I'm building a rather large app (the author/book was just a simple example)  and am finding myself doing this all over the place.  I thought about not returning the whole author object with the book, but just the authorId.  I think this would just save network chatter as I would still need to loop through the list, find the right author, and update the reference in the Book.  I think either I am missing something or there has to be a better approach.  How are you guys handling this?

Todd
3  Announcements and General Discussion / General Discussion / Re: multiple commands mapped to one notification on: April 21, 2008, 03:33:35
yea, that makes perfect sense.  Thanks for the clarification.  In my case, I don't care what order things are executed in, as long as they are executed after a specific notification.  Maybe I'll randomize them in my MacroCommand every time just for fun :)
4  Announcements and General Discussion / Architecture / Inversion of Control on: April 21, 2008, 02:55:06
I'll start by stating I'm a long time java developer recently turned to rails/flex.  The other day I was looking at a framework called parsley (http://www.spicefactory.org/parsley/).  They have developed many features from spring into AS3.  I LOVE the dependency injection part (interceptors are very nice too).  Thier MVC isn't nearly as mature as pureMVC.  When I start thinking how nice it would be if I could use dependency injection with pureMVC, I start salivating.  Wouldn't it be cool if you could do all the registering and mappings via an xml file? Registering commands to events, doing the mediator-view mappings, all that stuff would be beautiful, and greatly reduce the amount of AS3 clutter in my project. 

I know it probably won't happen.  But one can dream can't they?
5  Announcements and General Discussion / General Discussion / multiple commands mapped to one notification on: April 21, 2008, 02:39:54
So I wrote up a test app, and if I do this in my facade

:
registerCommand(EVENT1, HelloCommand);
registerCommand(EVENT1, WorldCommand);

Only the WorldCommand gets executed.  Is this by design? 
I would think I could map a plethora of commands to the same notification. 

I'm sure I'm missing something....
6  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: January 23, 2008, 03:47:38
sorry ... in the command
7  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: January 23, 2008, 10:27:26
You could use the 'type' parameter to the notification to hold the name of the module to load and let the body be the reference to the ModuleLoader to load said module into.

The way I got around it was inside my controller, I loaded the module using ModuleManager.getModule(), registered the module with the moduleFacade, then sent a LOAD_MODULE_SUCCESS notification with the IModuleInfo as the body.  The mediator that sent the request notification originally, is listening for that notification and then can do something like:

:
app.container.addChild( (notification.getBody() as IModuleInfo).factory.create() as Module2 );

--The positive, no moduleloaders to pass around, clean separation of controller from view components.

--The negative - The same notification is sent regardless of which module was loaded making loading multiple modules simultaniously ugly. (the mediators would have to inspect the module, or the controller could add the module name in the notifications type field.
8  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: January 22, 2008, 02:01:52
So I tried to implement this using your ModuleTest, but once I moved the module loading into a command object, I lost the ability to know which ModuleLoader to load the module into.  I'm sure you can chalk this up to my lack of experience, but how would you accomplish it?
9  PureMVC Manifold / MultiCore Version / Re: PureMVC + Modules on: January 21, 2008, 02:48:59
I am a PureMVC noob, but what do you think about moving the actual loading of the module into a LoadModuleCommand registered to listen to a LOAD_MODULE Notification, the body of the Notification can contain the module to load.  Then the ModuleMediator can do what other mediators do, and translate events into Notifications.  This would let you load modules from anywhere in your app (from other mediators, or commands)

Todd
10  Announcements and General Discussion / General Discussion / Re: Modular Applications with PureMVC on: January 18, 2008, 04:54:48
I'm having a similar problem loading two independent applications.  One app determines at run time it needs to load another puremvc app.  As the second one is starting up, the facade is not created because getInstance  is static and sees that instance is not null (obviously following the singleton pattern very well).  I guess I'm just saying that along the lines of what has been suggested about modules, also applies to loading multiple projects (via SWFLoader).
Pages: [1]