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 / Conditional AsyncCommands on: November 04, 2011, 08:21:49
Hey everyone !

When I started using AsyncCommands I encountered the situation where if I have a AsyncMacroCommand and one of its commands fails, the Macro keep on running.

This was problematic for me when some of the commands was depended on the failed commands and I wanted to stop the Macro flow when that happen.

So for solving that I wrote an extension to the AsyncCommand utility which I call ConditionalAsyncCommand.

I basically took the AsyncCommand and AsyncMacroCommand and added a boolean to the NextCommand method.

That way when an async command knows about a failure in the Proxy it's waiting for, it can send s onComplete(false) and that way the Macro would stop the loop.

I have 2 questions:

1. If it sounds like a valid solution for that problem? I've tested it and it works for me...

2. If it is, how can I publish it as an open source so it could benefit others (never done that before, so I don't really know about copyright issues and such)


Thanks a lot !
Shai
2  Announcements and General Discussion / Architecture / Can AsyncCommands act as responders? on: November 03, 2011, 09:52:41
I understand why SimpleCommand aren't,
But if an async command already waits for the onComplete, why can't it wait for a service call on the proxy?

So my question is if I'm calling a proxy from an AsyncCommand, and pass it the onComplete() as a callback function, is that considered a bad practice?


Thanks!
Shai
3  Announcements and General Discussion / Architecture / Commands as Mini Controllers on: June 23, 2010, 01:34:38
Hello Everyone,

I want to begin with mentioning that the PureMVC is awesome!!

A quick verification:

Is it ok to group related commands into one command, and call this command with different types to execute different sub-commands ?

An example:

I have a CreateProductsView, it has SUBMIT and INIT commands (usually there is more in my app),

I create a main Command called: "CreateProductsCommand" link it with "EXECUTE_CREATE_PRODUCTS_COMMAND" notification, and call that notification with type "INIT".

This way I can save the amount of command classes and notifications, and create a "mini controller" to that view, where if you want to look or changed anything, it is all under the same place (only in case other places doesn't need to use the same code of course)

Is it good practice? are there better ways?

Thanks,
Shai
Pages: [1]