Hi list!
As I promised here is my suggestion...
In Dimensions I had to use a workaround for a missing feature. In order to
resolve inheritances and overriding definitions between multiple
definition files, i need to follow these steps:
1) Find the "leaf" definition file;
2) build the path from this leaf to the root;
3) current file = root file, complete definitions = empty;
4) load current file into definitions;
5) override current file definitions into the complete definitions (via
the "extend" method
6) current file = next file in the path;
7) return to point 4 until end.
8) Resolve inheritances.

As you can see I need to follow the path twice (from the leaf to the root
and then from the root to the leaf). If you could put a method that add
all the missing definitions (i.e. add all definitions that are not already
present in a definitions set). This way I can follow the path only once
(from leaf to root), eventually reusing already loaded definitions files.

1) Find the "leaf" definition file;
2) If it is already loaded, finish.
3) Create an empty definitions set;
4) put all missing definitions loaded into the definitions set;
5) find the parent definition file;
6) if it is already loaded, put all missing definitions (by cloning them)
in the definitions set and go to 9;
7) if it is the root file, go to 9;
8) go to step 5;
9) resolve inheritances.

As you can see, there will be a big caching of already loaded definitions
files, only by adding two methods (addMissingDefinitions in
XmlDefinitionsSet and "clone" in XmlDefinition).
What do you think about it?
Ciao
Antonio Petrelli


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to