|Re: Issues with collectReachableObjectsOfType [message #631753 is a reply to message #631727]
||Fri, 08 October 2010 15:43
| Ed Merks
Registered: July 2009
Alain Picard wrote:
> As discussed by others a few years ago, collectReachableObjectsOfType
> is aggressively looking at the whole model, and when dealing with a
> "root" model that manages proxy references to a set of very huge
> models, this forces the loading of the whole graph, which can be
> millions of objects (over 14 millions reported from YourKit in my
> case) from all the referenced models.
> I probably can turn off the resolve proxy and that might avoid this
> situation, but that would force us to revise some of the code that
> expects on-demand loading of those models (1 by 1 normally, never all
> of them).
> But in looking at the current collectReachableObjectsOfType, I can't
> understand why it needs to visit the whole graph.
Objects of the right type can be lurking anywhere.
> I have a reference feature point to class C which extends class B and
> class A has a containment relation to class B.
> X --has feature --> Y
> Y --reference of type --> C
> C --extends --> B
> A --containment to --> B
> So the only way to get to C is to get the containment list of A and
> filter those elements which are of type C (not other subtypes of B).
Of course anyone can subtype any of these classes and introduce features
that make it possible reach objects of types you might not expect just
looking at the base model.
> So why can't collectReachableObjectsOfType actually apply such logic
> instead of looking at tons of unrelated objects?
Because of open ended derivation, there's no way to guarantee that you
can't reach objects of any particular type.
> Thanks for helping me understand here.
I think only if your domain is bounded can you apply this type of
analysis. I.e., if you know all EClass that might be used in the
instance, you could determine the possibility of reachability by the
analysis you've outlined.
Powered by FUDForum
. Page generated in 0.02257 seconds