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 / Getting Started / Re: Merging/combining commands? on: January 09, 2010, 01:36:06
When you merge those commands, those commands should be different I guess.

I'm not sure how it should work, but if you look at the implementation in the Flight Framework, those commands are ICombinableCommand. There's a manager class called CommandHistory. Within the executeCommand of this class a class variable "mergingCommand" is instantiated whenever there's a combinable command (much like the undoCmdClass). But how the Flight Framework deals with multiple combining or storage of the commands is not clear to me, it seems to me that they are linked through one another through the class variable "mergingCommand"?

overriding the initializeMacroCommand is not working, since this method is called on instantiation of the class, while you really want to be able to execute the combined commands each time you are undoing several commands combined.

using notifications is not possible either since you have no reference to the previous command

It is supposed to run the commands sequentially and in reverse order.

If you look at the undo-textfields project you can see an example of combining undo commands
into one undo command using flight framework 0.8
http://code.google.com/p/undo-textfields/




2  Announcements and General Discussion / Getting Started / Re: Merging/combining commands? on: January 08, 2010, 03:09:12
Seems logical

I'll try contacting Dragos to see if he can give some advice.

Thanks

Bill
3  Announcements and General Discussion / Getting Started / Merging/combining commands? on: January 06, 2010, 10:04:35
Hi,

How can you merge or combine commands in PureMVC?

Reason:
I make use of the AS3 Undo utility, and want to put multiple commands in one single undo command.
Now you have the initializeMacroCommand method, but then you have to know upfront what commands you wanna combine. What if you only know at runtime (by means of notifications) which commands you want to combine? It doesn't seem possible with pureMVC out-of-the-box, so you would have to create a helper class  to keep track of things right?
Furthermore, in the flight framework this is implemented through the IMergingCommand interface, so probably an idea for an enhancement to PureMVC?

Regards,

Bill
Pages: [1]