Home » Modeling » UML2 » Private Class from different Namespace as property type
Private Class from different Namespace as property type [message #477036] |
Sun, 09 March 2008 06:18  |
Eclipse User |
|
|
|
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--
|
|
| | | |
Re: Private Class from different Namespace as property type [message #477043 is a reply to message #477042] |
Mon, 10 March 2008 09:00   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------070806050705080205050501
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Felix,
UMLValidator is the centralized point from which constraints are
dispatched. The methods you see on the model are "invariants" that
should always return true. There can also be named constraints that will
appear only in the generator validator. You can read about the generic
EMF basis here:
The EMF Validation Framework Overview
< http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html>
Felix Dorner wrote:
> Hey Kenn,
> thanks for your answers. I am not sure if I understand this one -
> probably because I don't know of the general implementation strategy.
> So I got some more questions:
>
> Where can I find those validation rules? In the model? Are they tagged
> somehow? When looking at the model, I see a lot of operations with
> underscores, that have an EDiagnosticChain and some more strange
> parameters. These look like validation rules to me..(?) But they are
> ordinary EOperations, so the Validator must register them somewhere? I
> guess there's something I miss... where can I find the starting point
> to debug and check out how validation works?
>
> In this special case, if there is no validation rule that enforces
> visibility, does that mean that it's okay (i.e. fine with the spec) to
> have a non-visible Type as the type of a Property, or does it mean we
> should add a validation rule, and forbid that?
>
> Felix
>
--------------070806050705080205050501
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Felix,<br>
<br>
UMLValidator is the centralized point from which constraints are
dispatched. The methods you see on the model are "invariants" that
should always return true. There can also be named constraints that
will appear only in the generator validator. You can read about the
generic EMF basis here: <br>
<blockquote><a
href=" http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html">The
EMF Validation Framework Overview</a><br>
</blockquote>
<br>
Felix Dorner wrote:
<blockquote cite="mid:fr36hh$i93$1@build.eclipse.org" type="cite">Hey
Kenn,
<br>
thanks for your answers. I am not sure if I understand this one -
probably because I don't know of the general implementation strategy.
So I got some more questions:
<br>
<br>
Where can I find those validation rules? In the model? Are they tagged
somehow? When looking at the model, I see a lot of operations with
underscores, that have an EDiagnosticChain and some more strange
parameters. These look like validation rules to me..(?) But they are
ordinary EOperations, so the Validator must register them somewhere? I
guess there's something I miss... where can I find the starting point
to debug and check out how validation works?
<br>
<br>
In this special case, if there is no validation rule that enforces
visibility, does that mean that it's okay (i.e. fine with the spec) to
have a non-visible Type as the type of a Property, or does it mean we
should add a validation rule, and forbid that?
<br>
<br>
Felix
<br>
<br>
</blockquote>
<br>
</body>
</html>
--------------070806050705080205050501--
|
|
| | |
Re: Private Class from different Namespace as property type [message #477048 is a reply to message #477042] |
Mon, 10 March 2008 17:34   |
Eclipse User |
|
|
|
Felix,
I think there ought to be a validation rule for this; I'll look for one in
the specification, and if I can't find one, I'll raise an issue.
Kenn
"Felix Dorner" <felix_do@web.de> wrote in message
news:fr36hh$i93$1@build.eclipse.org...
> Hey Kenn,
> thanks for your answers. I am not sure if I understand this one - probably
> because I don't know of the general implementation strategy. So I got some
> more questions:
>
> Where can I find those validation rules? In the model? Are they tagged
> somehow? When looking at the model, I see a lot of operations with
> underscores, that have an EDiagnosticChain and some more strange
> parameters. These look like validation rules to me..(?) But they are
> ordinary EOperations, so the Validator must register them somewhere? I
> guess there's something I miss... where can I find the starting point to
> debug and check out how validation works?
>
> In this special case, if there is no validation rule that enforces
> visibility, does that mean that it's okay (i.e. fine with the spec) to
> have a non-visible Type as the type of a Property, or does it mean we
> should add a validation rule, and forbid that?
>
> Felix
>
|
|
| | |
Re: Private Class from different Namespace as property type [message #477125 is a reply to message #477048] |
Tue, 25 March 2008 15:50  |
Eclipse User |
|
|
|
Felix,
The issue has been raised - see
http://www.omg.org/issues/uml2-rtf.open.html#Issue12274.
Kenn
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fr49h8$ghg$1@build.eclipse.org...
> Felix,
>
> I think there ought to be a validation rule for this; I'll look for one in
> the specification, and if I can't find one, I'll raise an issue.
>
> Kenn
>
> "Felix Dorner" <felix_do@web.de> wrote in message
> news:fr36hh$i93$1@build.eclipse.org...
>> Hey Kenn,
>> thanks for your answers. I am not sure if I understand this one -
>> probably because I don't know of the general implementation strategy. So
>> I got some more questions:
>>
>> Where can I find those validation rules? In the model? Are they tagged
>> somehow? When looking at the model, I see a lot of operations with
>> underscores, that have an EDiagnosticChain and some more strange
>> parameters. These look like validation rules to me..(?) But they are
>> ordinary EOperations, so the Validator must register them somewhere? I
>> guess there's something I miss... where can I find the starting point to
>> debug and check out how validation works?
>>
>> In this special case, if there is no validation rule that enforces
>> visibility, does that mean that it's okay (i.e. fine with the spec) to
>> have a non-visible Type as the type of a Property, or does it mean we
>> should add a validation rule, and forbid that?
>>
>> Felix
>>
>
>
|
|
|
Re: Private Class from different Namespace as property type [message #626153 is a reply to message #477036] |
Sun, 09 March 2008 06:21  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------000703070903050203000603
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Oops, the attached model was wrong. Here is the correct one:
--------------000703070903050203000603
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="_PfzwEO3BEdywkskpwYWWXg"/>
</packagedElement>
</packagedElement>
</uml:Model>
--------------000703070903050203000603--
|
|
|
Re: Private Class from different Namespace as property type [message #626154 is a reply to message #477037] |
Sun, 09 March 2008 21:02  |
Eclipse User |
|
|
|
Felix,
Only a subset of the valdation rules are currently implemented - see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=80307 Mind you, I'm not even
sure there is a validation rule that enforces visibility...
Kenn
"Felix Dorner" <felix_do@web.de> wrote in message
news:fr0dmf$ghm$2@build.eclipse.org...
> Oops, the attached model was wrong. Here is the correct one:
>
>
>
------------------------------------------------------------ --------------------
> <?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="_PfzwEO3BEdywkskpwYWWXg"/>
> </packagedElement>
> </packagedElement>
> </uml:Model>
>
|
|
|
Re: Private Class from different Namespace as property type [message #626158 is a reply to message #477038] |
Mon, 10 March 2008 07:37  |
Eclipse User |
|
|
|
Hey Kenn,
thanks for your answers. I am not sure if I understand this one -
probably because I don't know of the general implementation strategy. So
I got some more questions:
Where can I find those validation rules? In the model? Are they tagged
somehow? When looking at the model, I see a lot of operations with
underscores, that have an EDiagnosticChain and some more strange
parameters. These look like validation rules to me..(?) But they are
ordinary EOperations, so the Validator must register them somewhere? I
guess there's something I miss... where can I find the starting point to
debug and check out how validation works?
In this special case, if there is no validation rule that enforces
visibility, does that mean that it's okay (i.e. fine with the spec) to
have a non-visible Type as the type of a Property, or does it mean we
should add a validation rule, and forbid that?
Felix
|
|
|
Re: Private Class from different Namespace as property type [message #626159 is a reply to message #477042] |
Mon, 10 March 2008 09:00  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------070806050705080205050501
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Felix,
UMLValidator is the centralized point from which constraints are
dispatched. The methods you see on the model are "invariants" that
should always return true. There can also be named constraints that will
appear only in the generator validator. You can read about the generic
EMF basis here:
The EMF Validation Framework Overview
< http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html>
Felix Dorner wrote:
> Hey Kenn,
> thanks for your answers. I am not sure if I understand this one -
> probably because I don't know of the general implementation strategy.
> So I got some more questions:
>
> Where can I find those validation rules? In the model? Are they tagged
> somehow? When looking at the model, I see a lot of operations with
> underscores, that have an EDiagnosticChain and some more strange
> parameters. These look like validation rules to me..(?) But they are
> ordinary EOperations, so the Validator must register them somewhere? I
> guess there's something I miss... where can I find the starting point
> to debug and check out how validation works?
>
> In this special case, if there is no validation rule that enforces
> visibility, does that mean that it's okay (i.e. fine with the spec) to
> have a non-visible Type as the type of a Property, or does it mean we
> should add a validation rule, and forbid that?
>
> Felix
>
--------------070806050705080205050501
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Felix,<br>
<br>
UMLValidator is the centralized point from which constraints are
dispatched. The methods you see on the model are "invariants" that
should always return true. There can also be named constraints that
will appear only in the generator validator. You can read about the
generic EMF basis here: <br>
<blockquote><a
href=" http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. emf.doc//references/overview/EMF.Validation.html">The
EMF Validation Framework Overview</a><br>
</blockquote>
<br>
Felix Dorner wrote:
<blockquote cite="mid:fr36hh$i93$1@build.eclipse.org" type="cite">Hey
Kenn,
<br>
thanks for your answers. I am not sure if I understand this one -
probably because I don't know of the general implementation strategy.
So I got some more questions:
<br>
<br>
Where can I find those validation rules? In the model? Are they tagged
somehow? When looking at the model, I see a lot of operations with
underscores, that have an EDiagnosticChain and some more strange
parameters. These look like validation rules to me..(?) But they are
ordinary EOperations, so the Validator must register them somewhere? I
guess there's something I miss... where can I find the starting point
to debug and check out how validation works?
<br>
<br>
In this special case, if there is no validation rule that enforces
visibility, does that mean that it's okay (i.e. fine with the spec) to
have a non-visible Type as the type of a Property, or does it mean we
should add a validation rule, and forbid that?
<br>
<br>
Felix
<br>
<br>
</blockquote>
<br>
</body>
</html>
--------------070806050705080205050501--
|
|
|
Re: Private Class from different Namespace as property type [message #626160 is a reply to message #477043] |
Mon, 10 March 2008 12:31  |
Eclipse User |
|
|
|
Hey Ed,
I see. All EOperations with the signature "name(EDiagnosticChain,
EMap<EJavaObject,EJavaObject>) : EBoolean" are interpreted as invariants
by the generator?
So probably the UML2 model is imported from a Rose model where the
invariant constraints (i.e. validation rules) can be specified more nicely.
Felix
|
|
|
Re: Private Class from different Namespace as property type [message #626161 is a reply to message #477044] |
Mon, 10 March 2008 13:42  |
Eclipse User |
|
|
|
Felix,
Yes, I believe the UML2 to Ecore processing converts invariants to EMF's
convention for representing them as EOperations with a specific style of
signature.
Felix Dorner wrote:
> Hey Ed,
>
> I see. All EOperations with the signature "name(EDiagnosticChain,
> EMap<EJavaObject,EJavaObject>) : EBoolean" are interpreted as
> invariants by the generator?
>
> So probably the UML2 model is imported from a Rose model where the
> invariant constraints (i.e. validation rules) can be specified more
> nicely.
>
> Felix
|
|
|
Re: Private Class from different Namespace as property type [message #626168 is a reply to message #477042] |
Mon, 10 March 2008 17:34  |
Eclipse User |
|
|
|
Felix,
I think there ought to be a validation rule for this; I'll look for one in
the specification, and if I can't find one, I'll raise an issue.
Kenn
"Felix Dorner" <felix_do@web.de> wrote in message
news:fr36hh$i93$1@build.eclipse.org...
> Hey Kenn,
> thanks for your answers. I am not sure if I understand this one - probably
> because I don't know of the general implementation strategy. So I got some
> more questions:
>
> Where can I find those validation rules? In the model? Are they tagged
> somehow? When looking at the model, I see a lot of operations with
> underscores, that have an EDiagnosticChain and some more strange
> parameters. These look like validation rules to me..(?) But they are
> ordinary EOperations, so the Validator must register them somewhere? I
> guess there's something I miss... where can I find the starting point to
> debug and check out how validation works?
>
> In this special case, if there is no validation rule that enforces
> visibility, does that mean that it's okay (i.e. fine with the spec) to
> have a non-visible Type as the type of a Property, or does it mean we
> should add a validation rule, and forbid that?
>
> Felix
>
|
|
|
Re: Private Class from different Namespace as property type [message #626171 is a reply to message #477048] |
Mon, 10 March 2008 18:13  |
Eclipse User |
|
|
|
Kenn Hussey wrote:
> Felix,
>
> I think there ought to be a validation rule for this; I'll look for one in
> the specification, and if I can't find one, I'll raise an issue.
Kenn, the main source of information to me is also the specification. I
have just started working with it and stoll dont quite grasp its layout.
When you say you look for a validation rule, you mean you look in the
"Constraints" sections of the element descriptions?
Felix
|
|
|
Re: Private Class from different Namespace as property type [message #626178 is a reply to message #477051] |
Tue, 11 March 2008 12:53  |
Eclipse User |
|
|
|
Yes.
Kenn
"Felix Dorner" <felix_do@web.de> wrote in message
news:fr4bpm$8p9$1@build.eclipse.org...
> Kenn Hussey wrote:
>> Felix,
>>
>> I think there ought to be a validation rule for this; I'll look for one
>> in the specification, and if I can't find one, I'll raise an issue.
>
> Kenn, the main source of information to me is also the specification. I
> have just started working with it and stoll dont quite grasp its layout.
> When you say you look for a validation rule, you mean you look in the
> "Constraints" sections of the element descriptions?
>
> Felix
|
|
|
Re: Private Class from different Namespace as property type [message #626260 is a reply to message #477048] |
Tue, 25 March 2008 15:50  |
Eclipse User |
|
|
|
Felix,
The issue has been raised - see
http://www.omg.org/issues/uml2-rtf.open.html#Issue12274
Kenn
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:fr49h8$ghg$1@build.eclipse.org...
> Felix,
>
> I think there ought to be a validation rule for this; I'll look for one in
> the specification, and if I can't find one, I'll raise an issue.
>
> Kenn
>
> "Felix Dorner" <felix_do@web.de> wrote in message
> news:fr36hh$i93$1@build.eclipse.org...
>> Hey Kenn,
>> thanks for your answers. I am not sure if I understand this one -
>> probably because I don't know of the general implementation strategy. So
>> I got some more questions:
>>
>> Where can I find those validation rules? In the model? Are they tagged
>> somehow? When looking at the model, I see a lot of operations with
>> underscores, that have an EDiagnosticChain and some more strange
>> parameters. These look like validation rules to me..(?) But they are
>> ordinary EOperations, so the Validator must register them somewhere? I
>> guess there's something I miss... where can I find the starting point to
>> debug and check out how validation works?
>>
>> In this special case, if there is no validation rule that enforces
>> visibility, does that mean that it's okay (i.e. fine with the spec) to
>> have a non-visible Type as the type of a Property, or does it mean we
>> should add a validation rule, and forbid that?
>>
>> Felix
>>
>
>
|
|
|
Goto Forum:
Current Time: Sun Aug 31 02:45:48 EDT 2025
Powered by FUDForum. Page generated in 0.03943 seconds
|