Stefan Seelmann wrote:
Emmanuel Lecharny wrote:
We have to be able to check that quickly (ie, without visiting all those
SO looking for this AT), that mean either adding some added fields in
all those SO (something like the list of OCs using this AT, added as a
set in the AT instance), or having a Map associating an SO with all the
SO's referencing it.

I think that the second solution is way better, as it does not add many
fields and setters/getters in a bunch of classes, and also is easy to
attach to the Registries. We just have to define a hashCode() for each
SO which is built using their OID (or ruleId) combined with their
ObjectType (to avoid collision, as some SO may have the same OID : MRUs
have the MR's ODI they are associated with).

So with the second solution all SO are in one map? So if you need to
know which OCs using this AT you have to loop over all map items and
check if they are OC.
Sorry, I mean, we need two tables :
o one for holding the list of SO a SO is using
o one for holding the list of SO using a SO
I'd vote for the first solution. I think that would be more reusable and
more object oriented. For example in Studio for the Schema _Browser_,
currently there is a totally inefficient SchemaUtils class [1] with
helper methods that loop over all SO to find references. It would be
cool if we could reuse this in Studio.
Well, with those 2 tables, you will have way better performances than wit the current methods of SchemaUtils !

At this point, the only risk I forsee is that this Map is not accessible
if the Registries is not accessible when we want to update it. Will see...

One risk I see are memory leaks, if SO are removed from the registries
but still referenced from other SOs.
Yes, but this is a theorical risk, as we are so damn good coders !!!

--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to