In SVG there is a feature of instantiating multiple elements of single vector objects. That is, you can define one "template" object and create as many its clones as you like. What is more, each instantiated clone can be transformed or have any style modifications if needed . That is, each clone can have its own stroke, fill, clipping path and clipping mask options. The options defined during instantiation override the options mentioned in the template.
This cloning feature can be applied not only to vector objects themselves, but also to the implicit objects that are used in styles, like patterns, gradients, clipping paths and masks.
So I have a set of questions, how should we handle this sharing of the objects? And should we handle it at all?
Basically, I want you to answer a set of questions for a set of possible (shareable) objects.
Set of objects:
- Pattern (consists of a set of usual objects, like in inkscape)
- Clip path (also consists of a set of objects that define an outline)
- Clip mask (the same as clip path, but also takes objects' opacity into account)
- Regular objects (first we define an invisible "template" object and create a lot of "instantiations" of it)
Set of questions:
- Do we need this sharing, or the loaded object should be deep-copied at the stage of loading the document?
- If we need sharing:
- How should we display that the object is instantiated using a template? Should we somehow group the objects having the same template?
- How the user whould "enter" the source (template) object and edit it?
- How the user should edit a particular instantiation of the template object? Please remember that an instantiation can also have some properties attached, that override the corresponding properties of the template.
I am really not sure about how we should proceed with it. Of course, the feature is quite advanced and probably not of the first priority, but we need to have an "ideal" design which we should seek to. The answers to the questions listed above define the basic design of the system I work at the moment :)