Private Class from different Namespace as property type [message #626152] |
Sun, 09 March 2008 10:18 |
Felix Dorner Messages: 676 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------010702080605020303030002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Hey,
I am stuck with the namespace mechanism. Reading the specs over and over
again, many things remain unclear to me, e.g.:
Suppose the class AClass is owned by a package A. Now AClass want's to
have a property of type BClass, which is owed by a package B.
Intuitively, this is only possible if the visibility of BClass is
public. I'd really rely on the specification to confirm this, but
reading it is a nightmare. I therefore experiment with the API and
created an example model that reflects the above structures. Contrary to
the intuition, even if I make BClass private, I can assign BClass as the
type of a property in AClass, and validation completes successfully!?
The model is attached. So there's two possibilities:
a. My intuition is wrong
b. The validation check is wrong / incomplete
Thanks for your comments.
Felix
--------------010702080605020303030002
Content-Type: text/xml;
name="visibility.uml"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="visibility.uml"
<?xml version="1.0" encoding="UTF-8"?>
<uml:Model xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML" xmi:id="_Kv-j4O3BEdywkskpwYWWXg" name="visibilitytest">
<packagedElement xmi:type="uml:Package" xmi:id="_NpnDcO3BEdywkskpwYWWXg" name="a">
<packagedElement xmi:type="uml:Class" xmi:id="_PfzwEO3BEdywkskpwYWWXg" name="AClass" visibility="private"/>
</packagedElement>
<packagedElement xmi:type="uml:Package" xmi:id="_RnYgkO3BEdywkskpwYWWXg" name="b">
<packagedElement xmi:type="uml:Class" xmi:id="_TFKGIO3BEdywkskpwYWWXg" name="BClass">
<ownedAttribute xmi:id="_VZijkO3BEdywkskpwYWWXg" name="bclass" type="_TFKGIO3BEdywkskpwYWWXg"/>
</packagedElement>
</packagedElement>
</uml:Model>
--------------010702080605020303030002--
|
|
|
Powered by
FUDForum. Page generated in 0.02705 seconds