Home » Modeling » UML2 » Resolving unqualified names
|
Re: Resolving unqualified names [message #477208 is a reply to message #477205] |
Tue, 08 April 2008 11:58 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Felix,
If you are trying to use unqualified references to School in some OCL
pre/post-condition constraint in the talk() operation context, then that
should work as you expect. MDT OCL knows the onion. :-)
Perhaps your situation doesn't involve OCL, but in implementing this
capability, we found that we needed to do it just as you suggest.
Cheers,
Christian
Felix Dorner wrote:
> Hey,
>
> Suppose I have the following Namespace/Package structure:
>
> |-p
> |-School
> |-q
> |-Teacher
> |-talk()
>
> Inside the talk() Operation, according to the specs, I can refer to School
> unqualified, since School is in an enclosing Namespace of Teacher. I tried
> to resolve the School element by querying q.members, but that doesn't find
> it. Reading the specs again, I understand why.
>
> So I guess I need to manually walk up the Namespace Onion, and query each
> Namespaces members :-P to resolve that name? I couldn't find an API call
> that already does that?
>
> Felix
|
|
| |
Re: Resolving unqualified names [message #626365 is a reply to message #477205] |
Tue, 08 April 2008 11:58 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Felix,
If you are trying to use unqualified references to School in some OCL
pre/post-condition constraint in the talk() operation context, then that
should work as you expect. MDT OCL knows the onion. :-)
Perhaps your situation doesn't involve OCL, but in implementing this
capability, we found that we needed to do it just as you suggest.
Cheers,
Christian
Felix Dorner wrote:
> Hey,
>
> Suppose I have the following Namespace/Package structure:
>
> |-p
> |-School
> |-q
> |-Teacher
> |-talk()
>
> Inside the talk() Operation, according to the specs, I can refer to School
> unqualified, since School is in an enclosing Namespace of Teacher. I tried
> to resolve the School element by querying q.members, but that doesn't find
> it. Reading the specs again, I understand why.
>
> So I guess I need to manually walk up the Namespace Onion, and query each
> Namespaces members :-P to resolve that name? I couldn't find an API call
> that already does that?
>
> Felix
|
|
| |
Goto Forum:
Current Time: Wed Apr 24 17:19:03 GMT 2024
Powered by FUDForum. Page generated in 0.02893 seconds
|