I'd have to review this more carefully to see what the compatibility implications are, but I've provided some quick feedback below off the top of my head. The existing API was created in an ad hoc fashion by encapsulating the original NSUML implementation, so it doesn't always seem very logical, but it is very important to maintain compatibility with the existing behavior. We can introduce new methods which have more logical behaviors if necessary.
On Nov 19, 2007 2:07 PM, Sérgio Lopes <[EMAIL PROTECTED]> wrote: > the method [...] getElement(List<String> path, Object namespace) > does not work if the root of path starts at the same level as the namespace. > For example, if namespace, is an object 'ns2', whose full path as obtained > with getPathList() is [model1, ns1, ns2], and path is [ns2, ns3, c1], the > method does not find the model element 'c1' (assuming it exists). > It will find elements when the root of path is a direct children (one > level below) the namespace. The current behavior sounds correct to me. If I lookup ns2 in ns2's ownedElements, I won't find it. > I think it would be useful to support the example above. It would enable > searching elements in models (top-level namespaces) providing a full path > obtained with getPathList(). Can we support that? I think a better way to allow this would be to allow a null namespace argument to signify the root of the repository. Historically, we've assumed a single top level root Model, but there can be multiple top level ModelElements and they don't have to be Models. That's why we've deprecated getRoot() and introduced getRoots() (although not all the code yet handles multiple roots/top level packages yet). > Finally, note that if we call the method with a full path to be searched in > a namespace that is not a model (top level namespace) the method still won't > > work. Is there any interest in handling these cases? I don't understand what you're trying to say here. The lookup is by definition relative the starting namespace. If you take a complete path that goes all the way to the top level and use it to try and lookup the element starting in a namespace which is further down the tree, it should fail. Can you clarify what you mean? Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
