Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Private Class from different Namespace as property type
Private Class from different Namespace as property type [message #626152] Sun, 09 March 2008 10:18
Felix Dorner is currently offline Felix DornerFriend
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--
Previous Topic:[Announce] MDT UML2 2.0.5 M200802262248 is available
Next Topic:Package::makesVisible insufficiently defined as OCL?
Goto Forum:
  


Current Time: Fri Apr 26 12:15:31 GMT 2024

Powered by FUDForum. Page generated in 0.02705 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top