Friday, 10 September 2010

Command Line Action removal

If you ever wanted to create a shape to the end, you will eventually have to write a visualization component named in NaroCAD's terms as Action or MetaAction. Actions are more lowlevel as they explicitly state the components (named inputs) of NaroCAD that you use and you should handle the data that those components give them to you. If you will want to make it a more straight forward action, mostly in cases you want to have full coverage of command line, tree view selection, and eventually want to start from your funciton of a shape, you should create a MetaAction.
MetaActions are as design a dependency list that was fulfilled by a generator action, named Command Line Action. That action will listen for you all dependencies and will fill dependencies of your meta-action. Eventually, when all dependencies are created, the shape is displayed, the tree view is updated, and so on.
So why was removed? And with what it was replaced? What happen to existing meta-actions code?
The CommandLineAction was removed and for every meta-action was created a corresponding container action named not imaginatively MetaActionContainer. This will have the same logic as CommandLineAction but will bring some advantages from QA standpoint: CLA was duplicating the action switching logic, because if you switch from Line to Circle, which happen that both are meta-actions, NaroCAD framework did not took it as a full switching of action, and CLA had to clean by itself all things that line meta-action does. Switching completely from a line container to a circle container, the bugs will not be related about bugs of switching meta-actions, but about more unlikely and easier to spot full action-switching bugs.
Another good part is that at code level (do you remember the _actionsGraph.SwitchMetaAction(ModifierNames.Line3D) from Boo coding?) there are no special treatment for actions and meta-actions. There were in some cases bugs in unit test suite that were become wrong (because an older action becomes a meta-action) and they will no longer trigger as the code evolve, switching from a meta-action to an action entry will be the same. Another very last thing, is that right now command line switching can be extended to switch in future to actions, not to meta-actions as it was previously as previously this logic was just in Command Line Action based meta-actions, and right now a command line switch may simply be just an action switch, which is a consistent practice.

No comments:

Post a Comment