Home » Modeling » UML2 » need clarification about "package import"(package import)
need clarification about "package import" [message #498926] |
Thu, 19 November 2009 08:54 |
|
Hi all,
after creating a "packageImport" into two packages p1 and p2 each containing a class named "class1" I get no warnings when I validate the model.
Is it normal? I would expect to get a warning to tell me that now two elements have the same name in same namespace (p1 namespace now contains two classes named "class1").
Did I miss something? or is it a bug?
Thanks
raphaël
|
|
| | |
Re: need clarification about "package import" [message #498982 is a reply to message #498926] |
Thu, 19 November 2009 12:34 |
|
--=-DCtQdl0gvM9gIFEa58Zg
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi, Rapha=C3=ABl,
As I understand it, the semantics of package import is to import only
elements of the package that do not clash with names already in the
importing namespace. This effectively ensures that the unique names
constraint cannot be violated by package import: in the extreme case,
the import would not bring in *any* names.
If you use element imports to import the two class1 elements, then the
constraint would be violated. However, with element import you can
assign an alias to give the imported element a distinct name in the
importing namespace.
HTH,
Christian
On Thu, 2009-11-19 at 03:54 -0500, Raphael Faudou wrote:
> Hi all,
> after creating a "packageImport" into two packages p1 and p2 each contain=
ing a class named "class1" I get no warnings when I validate the model.
> Is it normal? I would expect to get a warning to tell me that now two ele=
ments have the same name in same namespace (p1 namespace now contains two c=
lasses named "class1").
>=20
> Did I miss something? or is it a bug?
> Thanks
> rapha=C3=ABl
--=-DCtQdl0gvM9gIFEa58Zg
Content-Type: text/html; charset="utf-8"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Raphaël,<BR>
<BR>
As I understand it, the semantics of package import is to import only elements of the package that do not clash with names already in the importing namespace. This effectively ensures that the unique names constraint cannot be violated by package import: in the extreme case, the import would not bring in *any* names.<BR>
<BR>
If you use element imports to import the two class1 elements, then the constraint would be violated. However, with element import you can assign an alias to give the imported element a distinct name in the importing namespace.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Thu, 2009-11-19 at 03:54 -0500, Raphael Faudou wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi all,
after creating a "packageImport" into two packages p1 and p2 each containing a class named "class1" I get no warnings when I validate the model.
Is it normal? I would expect to get a warning to tell me that now two elements have the same name in same namespace (p1 namespace now contains two classes named "class1").
Did I miss something? or is it a bug?
Thanks
raphaël
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-DCtQdl0gvM9gIFEa58Zg--
|
|
|
Re: need clarification about "package import" [message #498988 is a reply to message #498982] |
Thu, 19 November 2009 13:12 |
|
Thanks a lot Christian !
Very clear and helpfull
Cheers
raphaël
Christian W. Damus a écrit :
> Hi, Raphaël,
>
> As I understand it, the semantics of package import is to import only
> elements of the package that do not clash with names already in the
> importing namespace. This effectively ensures that the unique names
> constraint cannot be violated by package import: in the extreme case,
> the import would not bring in *any* names.
>
> If you use element imports to import the two class1 elements, then the
> constraint would be violated. However, with element import you can
> assign an alias to give the imported element a distinct name in the
> importing namespace.
>
> HTH,
>
> Christian
>
>
> On Thu, 2009-11-19 at 03:54 -0500, Raphael Faudou wrote:
>> Hi all,
>> after creating a "packageImport" into two packages p1 and p2 each containing a class named "class1" I get no warnings when I validate the model.
>> Is it normal? I would expect to get a warning to tell me that now two elements have the same name in same namespace (p1 namespace now contains two classes named "class1").
>>
>> Did I miss something? or is it a bug?
>> Thanks
>> raphaël
|
|
|
Re: need clarification about "package import" [message #499204 is a reply to message #498970] |
Fri, 20 November 2009 12:28 |
Vlad Varnica Messages: 546 Registered: July 2009 Location: Milton Keynes - UK |
Senior Member |
|
|
Ed,
My comment below :
Vlad said: I mean that you can have two elements having the same name in the same package but no being identical.
Ed said: In this case they are in different packages.
Sorry Ed but for UML modeling you can have the same name in the same package. The management of the model is related to id and not to names and this is the best way to do. Imagine also that you refactor the name of one classifier. Now in the model the name has changed and how to make this change everywhere ? If the model is based on name management and not id then it is impossible and a serious limitation in the use of such a model. There is a post on our forum dealing with Soyatec eUML use of EMF with Java compare to EclipseUML use of Id. http://www.ejb3.org/new_architecture_features.html
Vlad said: The name control is a jdt compilation control which doesn't allow to have same classifier name inside the same package.
Ed said:There weren't any questions about Java so what does JDT have to do with the original question.
Hey Ed this an example coming from the real life nothing else !!
Vlad said: I don't see any value in adding a new model validation rule based on names inside the UML2 meta model validation process if all the logic is based on Ids management ?
Ed said: In fact there is such logic already. You can't have two classes with the same name in a single package.
No way for such a limitation !! you can have the same name as many times as needed for UML modeling purposes. I don't agree with your statements whcih make a confusion between EMF and UML modeling. This is not JDK compilation this is modeling stage !! When you add a package merge information between two package then this information is saved in the UML meta model. You don't need any other extension and for me the model is still valid because classifiers are managed by id and not by names.
btw, if the modeling projects are playing adding validation rules related to EMF and not to UML then we will stop using your plugins and wish you good luck for your modeling projects and topcased tool.
[Updated on: Fri, 20 November 2009 12:42] Report message to a moderator
|
|
|
Re: need clarification about "package import" [message #499216 is a reply to message #499204] |
Fri, 20 November 2009 13:07 |
|
--=-kYQCSlCkaQhhxs7EUN3W
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi, Vlad,
A UML modeling tool should absolutely permit users to create classes
having the same name in the same package. However, such a tool is also
expected to implement the UML metamodel's constraint defined for
Namespaces that requires all members of the namespace to be
distinguishable and to report violations of that constraint:
--------8<--------
Constraints
[1] All the members of a Namespace are distinguishable within it.
membersAreDistinguishable()
Additional Operations
[2] The Boolean query membersAreDistinguishable() determines whether all
of the namespace=E2=80=99s members are
distinguishable within it.
Namespace::membersAreDistinguishable() : Boolean;
membersAreDistinguishable =3D
self.member->forAll( memb |
self.member->excluding(memb)->forAll(other |
memb.isDistinguishableFrom(other, self)))
-------->8--------
Types (e.g., classes) are only distinguished in their containing
namespaces by their names. BehavioralFeatures (e.g., operations) are
distinguished by their signatures, which include feature name and
parameter types.
Of course the name of an element has nothing to do with object identity.
Everybody knows that :-)
Cheers,
Christian
On Fri, 2009-11-20 at 07:28 -0500, Vlad Varnica wrote:
> Ed,
>=20
> My comment below :
>=20
> Vlad said: I mean that you can have two elements having the same =
name in the same package but no being identical.
> Ed said : In this case they are in different packages.
>=20
> Sorry Ed but for UML modeling you can have the same name in the same pack=
age. The management of the model is related to id and not to names and this=
is the best way to do.
> Imagine also that you refactor the name of one classifier. Now in the mod=
el the name has changed and how to make this change everywhere ? If the mod=
el is based on name management and not id then it is impossible and a serio=
us limitation in the use of such a model [/B] There is a post on our forum =
dealing with Soyatec eUML use of EMF with Java compare to EclipseUML use of=
Id.
>=20
> Vlad said: The name control is a jdt compilation control which doe=
sn't allow to have same classifier name inside the same package.
> Ed said: There weren't any questions about Java so what does JDT h=
ave to do with the original question.
>=20
> Hey Ed this an example coming from the real life nothing else !!
>=20
> Vlad said: I don't see any value in adding a new model validation rule ba=
sed on names inside the UML2 meta model validation process if all the logic=
is based on Ids management ?
> Ed said: In fact there is such logic already. You can't have two classes =
with the same name in a single package.
>=20
> No way for such a limitation !! you can have the same name as many times =
as needed for UML modeling purposes. I don't agree with your statements whc=
ih make a confusion between EMF and UML modeling. This is not JDK compilati=
on this is modeling stage !!
>=20
> When you add a package merge information between two package then this in=
formation is saved in the UML meta model. You don't need any other extensio=
n and for me the model is still valid because classifiers are managed by id=
and not by names.
>=20
>=20
--=-kYQCSlCkaQhhxs7EUN3W
Content-Type: text/html; charset="utf-8"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Vlad,<BR>
<BR>
A UML modeling tool should absolutely permit users to create classes having the same name in the same package. However, such a tool is also expected to implement the UML metamodel's constraint defined for Namespaces that requires all members of the namespace to be distinguishable and to report violations of that constraint:<BR>
<BR>
--------8<--------<BR>
Constraints<BR>
[1] All the members of a Namespace are distinguishable within it.<BR>
membersAreDistinguishable()<BR>
<BR>
Additional Operations<BR>
[2] The Boolean query membersAreDistinguishable() determines whether all of the namespace’s members are<BR>
distinguishable within it.<BR>
Namespace::membersAreDistinguishable() : Boolean;<BR>
membersAreDistinguishable =<BR>
self.member->forAll( memb |<BR>
self.member->excluding(memb)->forAll(other |<BR>
memb.isDistinguishableFrom(other, self)))<BR>
-------->8--------<BR>
<BR>
Types (e.g., classes) are only distinguished in their containing namespaces by their names. BehavioralFeatures (e.g., operations) are distinguished by their signatures, which include feature name and parameter types.<BR>
<BR>
Of course the name of an element has nothing to do with object identity. Everybody knows that :-)<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
On Fri, 2009-11-20 at 07:28 -0500, Vlad Varnica wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Ed,
My comment below :
Vlad said: I mean that you can have two elements having the same name in the same package but no being identical.
Ed said : In this case they are in different packages.
Sorry Ed but for UML modeling you can have the same name in the same package. The management of the model is related to id and not to names and this is the best way to do.
Imagine also that you refactor the name of one classifier. Now in the model the name has changed and how to make this change everywhere ? If the model is based on name management and not id then it is impossible and a serious limitation in the use of such a model [/B] There is a post on our forum dealing with Soyatec eUML use of EMF with Java compare to EclipseUML use of Id.
Vlad said: The name control is a jdt compilation control which doesn't allow to have same classifier name inside the same package.
Ed said: There weren't any questions about Java so what does JDT have to do with the original question.
Hey Ed this an example coming from the real life nothing else !!
Vlad said: I don't see any value in adding a new model validation rule based on names inside the UML2 meta model validation process if all the logic is based on Ids management ?
Ed said: In fact there is such logic already. You can't have two classes with the same name in a single package.
No way for such a limitation !! you can have the same name as many times as needed for UML modeling purposes. I don't agree with your statements whcih make a confusion between EMF and UML modeling. This is not JDK compilation this is modeling stage !!
When you add a package merge information between two package then this information is saved in the UML meta model. You don't need any other extension and for me the model is still valid because classifiers are managed by id and not by names.
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-kYQCSlCkaQhhxs7EUN3W--
|
|
| |
Re: need clarification about "package import" [message #628078 is a reply to message #498982] |
Thu, 19 November 2009 13:12 |
|
Thanks a lot Christian !
Very clear and helpfull
Cheers
raphaël
Christian W. Damus a écrit :
> Hi, Raphaël,
>
> As I understand it, the semantics of package import is to import only
> elements of the package that do not clash with names already in the
> importing namespace. This effectively ensures that the unique names
> constraint cannot be violated by package import: in the extreme case,
> the import would not bring in *any* names.
>
> If you use element imports to import the two class1 elements, then the
> constraint would be violated. However, with element import you can
> assign an alias to give the imported element a distinct name in the
> importing namespace.
>
> HTH,
>
> Christian
>
>
> On Thu, 2009-11-19 at 03:54 -0500, Raphael Faudou wrote:
>> Hi all,
>> after creating a "packageImport" into two packages p1 and p2 each containing a class named "class1" I get no warnings when I validate the model.
>> Is it normal? I would expect to get a warning to tell me that now two elements have the same name in same namespace (p1 namespace now contains two classes named "class1").
>>
>> Did I miss something? or is it a bug?
>> Thanks
>> raphaël
|
|
| |
Re: need clarification about "package import" [message #628082 is a reply to message #628081] |
Fri, 20 November 2009 13:07 |
|
--=-kYQCSlCkaQhhxs7EUN3W
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hi, Vlad,
A UML modeling tool should absolutely permit users to create classes
having the same name in the same package. However, such a tool is also
expected to implement the UML metamodel's constraint defined for
Namespaces that requires all members of the namespace to be
distinguishable and to report violations of that constraint:
--------8<--------
Constraints
[1] All the members of a Namespace are distinguishable within it.
membersAreDistinguishable()
Additional Operations
[2] The Boolean query membersAreDistinguishable() determines whether all
of the namespace=E2=80=99s members are
distinguishable within it.
Namespace::membersAreDistinguishable() : Boolean;
membersAreDistinguishable =3D
self.member->forAll( memb |
self.member->excluding(memb)->forAll(other |
memb.isDistinguishableFrom(other, self)))
-------->8--------
Types (e.g., classes) are only distinguished in their containing
namespaces by their names. BehavioralFeatures (e.g., operations) are
distinguished by their signatures, which include feature name and
parameter types.
Of course the name of an element has nothing to do with object identity.
Everybody knows that :-)
Cheers,
Christian
On Fri, 2009-11-20 at 07:28 -0500, Vlad Varnica wrote:
> Ed,
>=20
> My comment below :
>=20
> Vlad said: I mean that you can have two elements having the same =
name in the same package but no being identical.
> Ed said : In this case they are in different packages.
>=20
> Sorry Ed but for UML modeling you can have the same name in the same pack=
age. The management of the model is related to id and not to names and this=
is the best way to do.
> Imagine also that you refactor the name of one classifier. Now in the mod=
el the name has changed and how to make this change everywhere ? If the mod=
el is based on name management and not id then it is impossible and a serio=
us limitation in the use of such a model [/B] There is a post on our forum =
dealing with Soyatec eUML use of EMF with Java compare to EclipseUML use of=
Id.
>=20
> Vlad said: The name control is a jdt compilation control which doe=
sn't allow to have same classifier name inside the same package.
> Ed said: There weren't any questions about Java so what does JDT h=
ave to do with the original question.
>=20
> Hey Ed this an example coming from the real life nothing else !!
>=20
> Vlad said: I don't see any value in adding a new model validation rule ba=
sed on names inside the UML2 meta model validation process if all the logic=
is based on Ids management ?
> Ed said: In fact there is such logic already. You can't have two classes =
with the same name in a single package.
>=20
> No way for such a limitation !! you can have the same name as many times =
as needed for UML modeling purposes. I don't agree with your statements whc=
ih make a confusion between EMF and UML modeling. This is not JDK compilati=
on this is modeling stage !!
>=20
> When you add a package merge information between two package then this in=
formation is saved in the UML meta model. You don't need any other extensio=
n and for me the model is still valid because classifiers are managed by id=
and not by names.
>=20
>=20
--=-kYQCSlCkaQhhxs7EUN3W
Content-Type: text/html; charset="utf-8"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Vlad,<BR>
<BR>
A UML modeling tool should absolutely permit users to create classes having the same name in the same package. However, such a tool is also expected to implement the UML metamodel's constraint defined for Namespaces that requires all members of the namespace to be distinguishable and to report violations of that constraint:<BR>
<BR>
--------8<--------<BR>
Constraints<BR>
[1] All the members of a Namespace are distinguishable within it.<BR>
membersAreDistinguishable()<BR>
<BR>
Additional Operations<BR>
[2] The Boolean query membersAreDistinguishable() determines whether all of the namespace’s members are<BR>
distinguishable within it.<BR>
Namespace::membersAreDistinguishable() : Boolean;<BR>
membersAreDistinguishable =<BR>
self.member->forAll( memb |<BR>
self.member->excluding(memb)->forAll(other |<BR>
memb.isDistinguishableFrom(other, self)))<BR>
-------->8--------<BR>
<BR>
Types (e.g., classes) are only distinguished in their containing namespaces by their names. BehavioralFeatures (e.g., operations) are distinguished by their signatures, which include feature name and parameter types.<BR>
<BR>
Of course the name of an element has nothing to do with object identity. Everybody knows that :-)<BR>
<BR>
Cheers,<BR>
<BR>
Christian<BR>
<BR>
On Fri, 2009-11-20 at 07:28 -0500, Vlad Varnica wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Ed,
My comment below :
Vlad said: I mean that you can have two elements having the same name in the same package but no being identical.
Ed said : In this case they are in different packages.
Sorry Ed but for UML modeling you can have the same name in the same package. The management of the model is related to id and not to names and this is the best way to do.
Imagine also that you refactor the name of one classifier. Now in the model the name has changed and how to make this change everywhere ? If the model is based on name management and not id then it is impossible and a serious limitation in the use of such a model [/B] There is a post on our forum dealing with Soyatec eUML use of EMF with Java compare to EclipseUML use of Id.
Vlad said: The name control is a jdt compilation control which doesn't allow to have same classifier name inside the same package.
Ed said: There weren't any questions about Java so what does JDT have to do with the original question.
Hey Ed this an example coming from the real life nothing else !!
Vlad said: I don't see any value in adding a new model validation rule based on names inside the UML2 meta model validation process if all the logic is based on Ids management ?
Ed said: In fact there is such logic already. You can't have two classes with the same name in a single package.
No way for such a limitation !! you can have the same name as many times as needed for UML modeling purposes. I don't agree with your statements whcih make a confusion between EMF and UML modeling. This is not JDK compilation this is modeling stage !!
When you add a package merge information between two package then this information is saved in the UML meta model. You don't need any other extension and for me the model is still valid because classifiers are managed by id and not by names.
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-kYQCSlCkaQhhxs7EUN3W--
|
|
| |
Goto Forum:
Current Time: Fri Apr 19 15:42:36 GMT 2024
Powered by FUDForum. Page generated in 0.02673 seconds
|