vocx wrote: ↑Wed Jul 29, 2020 12:19 am
I think since FreeCAD is sufficiently general, it is good that it has a base...
with the base system.
Yeap, another part of the problem is defining the base. To me, the base is the minimal FreeCAD file that have some objects with some properties.
Then, on top of the object model, there should be some object taxonomy and schema validation. Those taxonomies should be versioned and clearly documented. Ideally, a file specification should be published so that independent workbenches or completely separate applications could read and write the file given all the objects/properties are supported/well-known.
Then, there should be C++/Python APIs that modify/read the object model and emit signals when it's changed. Ideally, those are developed as a separate library in a different repository, so that many tools/workbenches can align to it and request an extension.
On top of those C++/Python APIs there should be the business layer: a set of rules to make sure the object model is consistent. That's the hard part - how to define the scope of the workbench, how to specify a set of properties the workbench can modify and listen to. Which version of the taxonomy it supports. How to ensure that the meaning/behavior of the property is not changed between versions (compatibility/deprecation policy).
On top of the business layer, there's a set of actions user wants to do. Those are use cases of the workbench - high-level representation of the user intent. This is so-called controller or interactor layer.
On top of user interactions, there's a presentation layer - a compact definition of actual widgets and UI elements to be displayed and their state.
So according to the above, the base would be:
- A set of object specifications/taxonomies
- A set of APIs to modify/subscribe to object properties in a given taxonomy
- A set of APIs to define a set of business rules
- A set of APIs to define user interactions with an object and maybe some standard interactions common for all workbenches
- A set of APIs to define object presentation
So for starters, I would try to define the following:
- Global/User Settings/Preferences. How many are there? What they mean? What makes a user preference rather than a property of an object? What's the policy of introducing new preferences by the workbench?
- Document properties. Is there such a concept? How can we ensure that the document opened by two users has the same object model? That is, object model is not impacted by the user preferences. Should the default values of properties be stored in the document? WHich ones?
- Object properties. How many object types are there? Which properties are there? Which properties can reference which object types? Are the objects duck-typed or there should be a strict schema?
- Visibility guidelines (what the user sees). Which object types are shown in the document tree? Which properties are shown in the properties view? What defines nesting? Are edges and points true objects or generated on the fly?
- Naming/Referencing/Identification. How to identify an object? Should UUID be used underneath the user provided strings? How to deal with toponaming? What if an object doesn't have any faces/edges/points? What if a type of an object is changed?