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 / 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
2  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?
3  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....
Pages: [1]