Posts Tagged ‘complex commands’


Nimbus – Macro Commands

04.29.2009
UPDATE: Since the writing of this post, I’ve converted to and fully endorse Robotlegs as my MVC framework of choice. I invite you to check it out. I have likewise since converted the concept of macro commands to Robotlegs in a extension called Macrobot.


In my recent intro to Nimbus, I mentioned that one of the features of Nimbus is macro commands. In complex applications, macro commands can be a huge time saver and allow you to have a lot of control over handling a group of service calls with minimal code.

Two types of macro commands exist. The first is a SequenceCommand. This means its subcommands will be executed sequentially. In other words, the second subcommand won’t begin executing until the first subcommand has finished executing. The SequenceCommand won’t be considered complete until the last subcommand has finished executing.

The other type of macro command is a ParallelCommand. As you may have guessed, this means its subcommands will be executed in parallel. In other words, the first command and second command will execute at the same time. The ParallelCommand won’t be considered complete until all subcommands have finished executing.

Just as the synergy of the Planeteers can work miracles, so can the synergy of the SequenceCommand and ParallelCommand. Nesting macro commands can give some enhanced control as we’ll see here: Continue reading »