Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » type conformance
type conformance [message #470397] Tue, 13 February 2007 17:55 Go to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
For the following snippet:

Type t = ...
System.out.println(t.conformsTo(t));

This always produces "false" (unless t is a Classifier). A type should
at least conform to itself, shouldn't it?

Rafael
Re: type conformance [message #470404 is a reply to message #470397] Wed, 14 February 2007 01:46 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Rafael.

Have a look at the spec on p. 138 under "Type". It states: " The query
conformsTo() gives true for a type that conforms to another. By default,
two types do not conform to each other. This query is intended to be
redefined for specific conformance situations."

So in your code snippet it I would expect the result to always be false.

By the way, the documentation for the API (ie have a look at
"Type.conformsTo()" ) is derived from the spec so you often don't have to
dig your way through the spec to discover the intention behind the public
API.

Regards,

- James.


"Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
news:eqsqgo$tbr$1@utils.eclipse.org...
> For the following snippet:
>
> Type t = ...
> System.out.println(t.conformsTo(t));
>
> This always produces "false" (unless t is a Classifier). A type should at
> least conform to itself, shouldn't it?
>
> Rafael
Re: type conformance [message #470406 is a reply to message #470404] Wed, 14 February 2007 03:50 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Note, however, that Classifier is the only specialization of Type in UML,
and since Type is abstract, in practice you should expect that all types
(classifiers) from UML conform to themselves...

Kenn

"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:eqtphb$oj1$1@utils.eclipse.org...
> Hi Rafael.
>
> Have a look at the spec on p. 138 under "Type". It states: " The query
> conformsTo() gives true for a type that conforms to another. By default,
> two types do not conform to each other. This query is intended to be
> redefined for specific conformance situations."
>
> So in your code snippet it I would expect the result to always be false.
>
> By the way, the documentation for the API (ie have a look at
> "Type.conformsTo()" ) is derived from the spec so you often don't have to
> dig your way through the spec to discover the intention behind the public
> API.
>
> Regards,
>
> - James.
>
>
> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:eqsqgo$tbr$1@utils.eclipse.org...
>> For the following snippet:
>>
>> Type t = ...
>> System.out.println(t.conformsTo(t));
>>
>> This always produces "false" (unless t is a Classifier). A type should at
>> least conform to itself, shouldn't it?
>>
>> Rafael
>
>
Re: type conformance [message #470408 is a reply to message #470404] Wed, 14 February 2007 03:56 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Hi James,

In "t.conformsTo(t)" there is only one type involved, so the rule "two
types do not conform to each other" does not apply here. In other words,
the spec is not complete enough as it does not cover all cases.

The simple idea that a type does not conform to itself gives me a
headache. Unless I totally missed what the semantics of conformsTo is
intended for (I see it as something like
java.lang.Class.isAssignableFrom(Class)).

Thanks,

Rafael

James Bruck wrote:

> Hi Rafael.

> Have a look at the spec on p. 138 under "Type". It states: " The query
> conformsTo() gives true for a type that conforms to another. By default,
> two types do not conform to each other. This query is intended to be
> redefined for specific conformance situations."

> So in your code snippet it I would expect the result to always be false.

> By the way, the documentation for the API (ie have a look at
> "Type.conformsTo()" ) is derived from the spec so you often don't have to
> dig your way through the spec to discover the intention behind the public
> API.

> Regards,

> - James.


> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:eqsqgo$tbr$1@utils.eclipse.org...
>> For the following snippet:
>>
>> Type t = ...
>> System.out.println(t.conformsTo(t));
>>
>> This always produces "false" (unless t is a Classifier). A type should at
>> least conform to itself, shouldn't it?
>>
>> Rafael
Re: type conformance [message #470412 is a reply to message #470406] Wed, 14 February 2007 12:40 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
True, I didn't realize that all subclasses of Type are also Classifiers.
Then the spec issue was a red herring. I was having problems and really
thought I saw the behavior I described, I guess based on Type#conformsTo
spec and impl. But as you pointed out, that code is never be executed,
so the behavior I described actually can never happen.

Thanks,

Rafael

Kenn Hussey wrote:
> Note, however, that Classifier is the only specialization of Type in UML,
> and since Type is abstract, in practice you should expect that all types
> (classifiers) from UML conform to themselves...
>
> Kenn
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:eqtphb$oj1$1@utils.eclipse.org...
>> Hi Rafael.
>>
>> Have a look at the spec on p. 138 under "Type". It states: " The query
>> conformsTo() gives true for a type that conforms to another. By default,
>> two types do not conform to each other. This query is intended to be
>> redefined for specific conformance situations."
>>
>> So in your code snippet it I would expect the result to always be false.
>>
>> By the way, the documentation for the API (ie have a look at
>> "Type.conformsTo()" ) is derived from the spec so you often don't have to
>> dig your way through the spec to discover the intention behind the public
>> API.
>>
>> Regards,
>>
>> - James.
>>
>>
>> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
>> news:eqsqgo$tbr$1@utils.eclipse.org...
>>> For the following snippet:
>>>
>>> Type t = ...
>>> System.out.println(t.conformsTo(t));
>>>
>>> This always produces "false" (unless t is a Classifier). A type should at
>>> least conform to itself, shouldn't it?
>>>
>>> Rafael
>>
>
>
Re: type conformance [message #588671 is a reply to message #470397] Wed, 14 February 2007 01:46 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Rafael.

Have a look at the spec on p. 138 under "Type". It states: " The query
conformsTo() gives true for a type that conforms to another. By default,
two types do not conform to each other. This query is intended to be
redefined for specific conformance situations."

So in your code snippet it I would expect the result to always be false.

By the way, the documentation for the API (ie have a look at
"Type.conformsTo()" ) is derived from the spec so you often don't have to
dig your way through the spec to discover the intention behind the public
API.

Regards,

- James.


"Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
news:eqsqgo$tbr$1@utils.eclipse.org...
> For the following snippet:
>
> Type t = ...
> System.out.println(t.conformsTo(t));
>
> This always produces "false" (unless t is a Classifier). A type should at
> least conform to itself, shouldn't it?
>
> Rafael
Re: type conformance [message #588683 is a reply to message #470404] Wed, 14 February 2007 03:50 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Note, however, that Classifier is the only specialization of Type in UML,
and since Type is abstract, in practice you should expect that all types
(classifiers) from UML conform to themselves...

Kenn

"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:eqtphb$oj1$1@utils.eclipse.org...
> Hi Rafael.
>
> Have a look at the spec on p. 138 under "Type". It states: " The query
> conformsTo() gives true for a type that conforms to another. By default,
> two types do not conform to each other. This query is intended to be
> redefined for specific conformance situations."
>
> So in your code snippet it I would expect the result to always be false.
>
> By the way, the documentation for the API (ie have a look at
> "Type.conformsTo()" ) is derived from the spec so you often don't have to
> dig your way through the spec to discover the intention behind the public
> API.
>
> Regards,
>
> - James.
>
>
> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:eqsqgo$tbr$1@utils.eclipse.org...
>> For the following snippet:
>>
>> Type t = ...
>> System.out.println(t.conformsTo(t));
>>
>> This always produces "false" (unless t is a Classifier). A type should at
>> least conform to itself, shouldn't it?
>>
>> Rafael
>
>
Re: type conformance [message #588689 is a reply to message #470404] Wed, 14 February 2007 03:56 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
Hi James,

In "t.conformsTo(t)" there is only one type involved, so the rule "two
types do not conform to each other" does not apply here. In other words,
the spec is not complete enough as it does not cover all cases.

The simple idea that a type does not conform to itself gives me a
headache. Unless I totally missed what the semantics of conformsTo is
intended for (I see it as something like
java.lang.Class.isAssignableFrom(Class)).

Thanks,

Rafael

James Bruck wrote:

> Hi Rafael.

> Have a look at the spec on p. 138 under "Type". It states: " The query
> conformsTo() gives true for a type that conforms to another. By default,
> two types do not conform to each other. This query is intended to be
> redefined for specific conformance situations."

> So in your code snippet it I would expect the result to always be false.

> By the way, the documentation for the API (ie have a look at
> "Type.conformsTo()" ) is derived from the spec so you often don't have to
> dig your way through the spec to discover the intention behind the public
> API.

> Regards,

> - James.


> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
> news:eqsqgo$tbr$1@utils.eclipse.org...
>> For the following snippet:
>>
>> Type t = ...
>> System.out.println(t.conformsTo(t));
>>
>> This always produces "false" (unless t is a Classifier). A type should at
>> least conform to itself, shouldn't it?
>>
>> Rafael
Re: type conformance [message #588708 is a reply to message #470406] Wed, 14 February 2007 12:40 Go to previous message
Rafael Chaves is currently offline Rafael ChavesFriend
Messages: 362
Registered: July 2009
Senior Member
True, I didn't realize that all subclasses of Type are also Classifiers.
Then the spec issue was a red herring. I was having problems and really
thought I saw the behavior I described, I guess based on Type#conformsTo
spec and impl. But as you pointed out, that code is never be executed,
so the behavior I described actually can never happen.

Thanks,

Rafael

Kenn Hussey wrote:
> Note, however, that Classifier is the only specialization of Type in UML,
> and since Type is abstract, in practice you should expect that all types
> (classifiers) from UML conform to themselves...
>
> Kenn
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:eqtphb$oj1$1@utils.eclipse.org...
>> Hi Rafael.
>>
>> Have a look at the spec on p. 138 under "Type". It states: " The query
>> conformsTo() gives true for a type that conforms to another. By default,
>> two types do not conform to each other. This query is intended to be
>> redefined for specific conformance situations."
>>
>> So in your code snippet it I would expect the result to always be false.
>>
>> By the way, the documentation for the API (ie have a look at
>> "Type.conformsTo()" ) is derived from the spec so you often don't have to
>> dig your way through the spec to discover the intention behind the public
>> API.
>>
>> Regards,
>>
>> - James.
>>
>>
>> "Rafael Chaves" <chaves@inf.ufsc.nospam.br> wrote in message
>> news:eqsqgo$tbr$1@utils.eclipse.org...
>>> For the following snippet:
>>>
>>> Type t = ...
>>> System.out.println(t.conformsTo(t));
>>>
>>> This always produces "false" (unless t is a Classifier). A type should at
>>> least conform to itself, shouldn't it?
>>>
>>> Rafael
>>
>
>
Previous Topic:Re: ConcurrentModificationExceptions with ECoreUtil.resolveAll
Next Topic:Re: ConcurrentModificationExceptions with ECoreUtil.resolveAll
Goto Forum:
  


Current Time: Thu Apr 18 15:22:52 GMT 2024

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

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

Back to the top