Tuesday, October 26, 2010

Pinning Down Bugs and Cleaning Plugin Interfaces

The first part is more clear from title: a crash that happen to be in this simple case:
var document = new Document();
document.Commit("A point was added");
did crash NaroCAD. This happen for a wrong usage of NaroCAD framework, but as right now this case was solved.
Also unit testing was added in this area, to not make it crash again.
An area that was fixed was to reduce dependencies when you implement a plugin.
So as you write a plugin you will be able to extend starting from 3 points:
- interpreters: adding persistent data (custom data) in the data tree that is storing information as colors and so on
- functions: adding your custom shape (like circle, line, box, tools)
- ActionGraph one: as action graph you will have already access to extend Inputs and Actions. The good part is that this ActionGraph will offer as Inputs some factories that are less used or are defined related with actions. This change will reduce all dependencies needed to extend NaroCAD to just one dependency: ActionGraph, and also gives possibility to add later new factories (for example ways to add custom hinting rules).
I will focus to fix bugs that are annoying and I will polish documentation how to make plugins.
Also a small good side effect is that the inputs were split in three categories:
- Infrastructure - like basic controls for opening/save files, the document context, OpenCascade view
- Factories - like already told PropertGrid factories to extend the sections of it, UIBuilder to add to Ribbon or other UI elements some other functionality
- Pipes: that combine Inputs functionality and give high level functionality. As examples are: Face picker pipe, or Selection Container, that provides for people that extend NaroCAD an easy to use form of using selection.
This will mean that NaroCAD can have just the first two sets: Infrastructure and Factories inputs, and almost all NaroCAD can be split in plugins, not just only actions. This also makes for someone looking what those inputs consists in, to navigate easier to them.

No comments: