Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Problem with Property Redefinition and Subsetting
Problem with Property Redefinition and Subsetting [message #477383] Wed, 14 May 2008 13:48 Go to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

I have redefined properties, thus:

class A
- property u1 [0..1] {derived union}

class B -> A
- property p1 [1] {subsets u1}

class C -> B
- property p2 [1] {redefines p1}

If, given an instance 'c' of C, I to

c.setP2(somevalue)

and subsequently do

c.getU1()

I get a null result. If, instead, I had first done

c.setP1(somevalue)

I would have got the expected result from the getU1() call.

The reason why this is happening is that the implementation of getU1()
is in the BImpl class; C does not override it. getU1() checks whether
p1 is set (eIsSet method), which does not consider the fact that it may
be implicitly set by p2 having been set.

Does this sound right?

I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #477384 is a reply to message #477383] Wed, 14 May 2008 13:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

A little more detail:

The BImpl::basicGetU1() method checks eIsSet(p1) and delegates to super
if not.

The p2 redefinition of p1 would be completed by generating a
CImpl::basicGetU1() method that checks eIsSet(p2) and delegates to super
(i.e., BImpl::basicGetU1() method) if not.

It seems that the subset-ness of the redefined property needs to be
re-specified on the redefining property in my source model?

Cheers,

Christian


Christian W. Damus wrote:
> I have redefined properties, thus:
>
> class A
> - property u1 [0..1] {derived union}
>
> class B -> A
> - property p1 [1] {subsets u1}
>
> class C -> B
> - property p2 [1] {redefines p1}
>
> If, given an instance 'c' of C, I to
>
> c.setP2(somevalue)
>
> and subsequently do
>
> c.getU1()
>
> I get a null result. If, instead, I had first done
>
> c.setP1(somevalue)
>
> I would have got the expected result from the getU1() call.
>
> The reason why this is happening is that the implementation of getU1()
> is in the BImpl class; C does not override it. getU1() checks whether
> p1 is set (eIsSet method), which does not consider the fact that it may
> be implicitly set by p2 having been set.
>
> Does this sound right?
>
> I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #477385 is a reply to message #477383] Wed, 14 May 2008 14:13 Go to previous messageGo to next message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Christian,

At first glance, this does not seem to be a correct implementation.
Please raise a defect.

Cheers,
- James.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g0f8kk$3gc$1@build.eclipse.org...
>I have redefined properties, thus:
>
> class A
> - property u1 [0..1] {derived union}
>
> class B -> A
> - property p1 [1] {subsets u1}
>
> class C -> B
> - property p2 [1] {redefines p1}
>
> If, given an instance 'c' of C, I to
>
> c.setP2(somevalue)
>
> and subsequently do
>
> c.getU1()
>
> I get a null result. If, instead, I had first done
>
> c.setP1(somevalue)
>
> I would have got the expected result from the getU1() call.
>
> The reason why this is happening is that the implementation of getU1() is
> in the BImpl class; C does not override it. getU1() checks whether p1 is
> set (eIsSet method), which does not consider the fact that it may be
> implicitly set by p2 having been set.
>
> Does this sound right?
>
> I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #477391 is a reply to message #477384] Fri, 16 May 2008 20:11 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Christian,

Redefinition in UML follows replacement semantics, so yes, you would have to
re-specify on p2 all of the characteristics you wish it to have (including
the fact that it subsets u1).

Kenn

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g0f9al$bdl$1@build.eclipse.org...
>A little more detail:
>
> The BImpl::basicGetU1() method checks eIsSet(p1) and delegates to super if
> not.
>
> The p2 redefinition of p1 would be completed by generating a
> CImpl::basicGetU1() method that checks eIsSet(p2) and delegates to super
> (i.e., BImpl::basicGetU1() method) if not.
>
> It seems that the subset-ness of the redefined property needs to be
> re-specified on the redefining property in my source model?
>
> Cheers,
>
> Christian
>
>
> Christian W. Damus wrote:
>> I have redefined properties, thus:
>>
>> class A
>> - property u1 [0..1] {derived union}
>>
>> class B -> A
>> - property p1 [1] {subsets u1}
>>
>> class C -> B
>> - property p2 [1] {redefines p1}
>>
>> If, given an instance 'c' of C, I to
>>
>> c.setP2(somevalue)
>>
>> and subsequently do
>>
>> c.getU1()
>>
>> I get a null result. If, instead, I had first done
>>
>> c.setP1(somevalue)
>>
>> I would have got the expected result from the getU1() call.
>>
>> The reason why this is happening is that the implementation of getU1() is
>> in the BImpl class; C does not override it. getU1() checks whether p1 is
>> set (eIsSet method), which does not consider the fact that it may be
>> implicitly set by p2 having been set.
>>
>> Does this sound right?
>>
>> I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #477392 is a reply to message #477385] Fri, 16 May 2008 20:12 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
James,

I'm not convinced this is a defect, actually - see my reply to Christian.

Kenn

"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:g0fa4e$kn4$1@build.eclipse.org...
> Hi Christian,
>
> At first glance, this does not seem to be a correct implementation.
> Please raise a defect.
>
> Cheers,
> - James.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:g0f8kk$3gc$1@build.eclipse.org...
>>I have redefined properties, thus:
>>
>> class A
>> - property u1 [0..1] {derived union}
>>
>> class B -> A
>> - property p1 [1] {subsets u1}
>>
>> class C -> B
>> - property p2 [1] {redefines p1}
>>
>> If, given an instance 'c' of C, I to
>>
>> c.setP2(somevalue)
>>
>> and subsequently do
>>
>> c.getU1()
>>
>> I get a null result. If, instead, I had first done
>>
>> c.setP1(somevalue)
>>
>> I would have got the expected result from the getU1() call.
>>
>> The reason why this is happening is that the implementation of getU1() is
>> in the BImpl class; C does not override it. getU1() checks whether p1 is
>> set (eIsSet method), which does not consider the fact that it may be
>> implicitly set by p2 having been set.
>>
>> Does this sound right?
>>
>> I am using UML2 2.1.1 release.
>
>
Re: Problem with Property Redefinition and Subsetting [message #477396 is a reply to message #477391] Sun, 18 May 2008 14:09 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Thanks, Kenn.

That is exactly how I "worked around" the problem in my model, by
re-specifying the subsetted property.

Glad to know it's not actually a work-around!

cW

On Friday 05-16-2008 (08:11), Kenn Hussey wrote:
> Christian,

> Redefinition in UML follows replacement semantics, so yes, you would
> have to re-specify on p2 all of the characteristics you wish it to
> have (including the fact that it subsets u1).

> Kenn

> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:g0f9al$bdl$1@build.eclipse.org...
>> A little more detail:

>> The BImpl::basicGetU1() method checks eIsSet(p1) and delegates to
>> super if not.

>> The p2 redefinition of p1 would be completed by generating a
>> CImpl::basicGetU1() method that checks eIsSet(p2) and delegates to
>> super (i.e., BImpl::basicGetU1() method) if not.

>> It seems that the subset-ness of the redefined property needs to
>> be re-specified on the redefining property in my source model?

>> Cheers,

>> Christian

>> Christian W. Damus wrote:
>>> I have redefined properties, thus:

>>> class A
>>> - property u1 [0..1] {derived union}

>>> class B -> A
>>> - property p1 [1] {subsets u1}

>>> class C -> B
>>> - property p2 [1] {redefines p1}

>>> If, given an instance 'c' of C, I to

>>> c.setP2(somevalue)

>>> and subsequently do

>>> c.getU1()

>>> I get a null result. If, instead, I had first done

>>> c.setP1(somevalue)

>>> I would have got the expected result from the getU1() call.

>>> The reason why this is happening is that the implementation of
>>> getU1() is in the BImpl class; C does not override it. getU1()
>>> checks whether p1 is set (eIsSet method), which does not consider
>>> the fact that it may be implicitly set by p2 having been set.

>>> Does this sound right?

>>> I am using UML2 2.1.1 release.




--

I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
Re: Problem with Property Redefinition and Subsetting [message #626563 is a reply to message #477383] Wed, 14 May 2008 13:59 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

A little more detail:

The BImpl::basicGetU1() method checks eIsSet(p1) and delegates to super
if not.

The p2 redefinition of p1 would be completed by generating a
CImpl::basicGetU1() method that checks eIsSet(p2) and delegates to super
(i.e., BImpl::basicGetU1() method) if not.

It seems that the subset-ness of the redefined property needs to be
re-specified on the redefining property in my source model?

Cheers,

Christian


Christian W. Damus wrote:
> I have redefined properties, thus:
>
> class A
> - property u1 [0..1] {derived union}
>
> class B -> A
> - property p1 [1] {subsets u1}
>
> class C -> B
> - property p2 [1] {redefines p1}
>
> If, given an instance 'c' of C, I to
>
> c.setP2(somevalue)
>
> and subsequently do
>
> c.getU1()
>
> I get a null result. If, instead, I had first done
>
> c.setP1(somevalue)
>
> I would have got the expected result from the getU1() call.
>
> The reason why this is happening is that the implementation of getU1()
> is in the BImpl class; C does not override it. getU1() checks whether
> p1 is set (eIsSet method), which does not consider the fact that it may
> be implicitly set by p2 having been set.
>
> Does this sound right?
>
> I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #626564 is a reply to message #477383] Wed, 14 May 2008 14:13 Go to previous message
james bruck is currently offline james bruck
Messages: 1724
Registered: July 2009
Senior Member
Hi Christian,

At first glance, this does not seem to be a correct implementation.
Please raise a defect.

Cheers,
- James.

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g0f8kk$3gc$1@build.eclipse.org...
>I have redefined properties, thus:
>
> class A
> - property u1 [0..1] {derived union}
>
> class B -> A
> - property p1 [1] {subsets u1}
>
> class C -> B
> - property p2 [1] {redefines p1}
>
> If, given an instance 'c' of C, I to
>
> c.setP2(somevalue)
>
> and subsequently do
>
> c.getU1()
>
> I get a null result. If, instead, I had first done
>
> c.setP1(somevalue)
>
> I would have got the expected result from the getU1() call.
>
> The reason why this is happening is that the implementation of getU1() is
> in the BImpl class; C does not override it. getU1() checks whether p1 is
> set (eIsSet method), which does not consider the fact that it may be
> implicitly set by p2 having been set.
>
> Does this sound right?
>
> I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #626570 is a reply to message #477384] Fri, 16 May 2008 20:11 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
Christian,

Redefinition in UML follows replacement semantics, so yes, you would have to
re-specify on p2 all of the characteristics you wish it to have (including
the fact that it subsets u1).

Kenn

"Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
news:g0f9al$bdl$1@build.eclipse.org...
>A little more detail:
>
> The BImpl::basicGetU1() method checks eIsSet(p1) and delegates to super if
> not.
>
> The p2 redefinition of p1 would be completed by generating a
> CImpl::basicGetU1() method that checks eIsSet(p2) and delegates to super
> (i.e., BImpl::basicGetU1() method) if not.
>
> It seems that the subset-ness of the redefined property needs to be
> re-specified on the redefining property in my source model?
>
> Cheers,
>
> Christian
>
>
> Christian W. Damus wrote:
>> I have redefined properties, thus:
>>
>> class A
>> - property u1 [0..1] {derived union}
>>
>> class B -> A
>> - property p1 [1] {subsets u1}
>>
>> class C -> B
>> - property p2 [1] {redefines p1}
>>
>> If, given an instance 'c' of C, I to
>>
>> c.setP2(somevalue)
>>
>> and subsequently do
>>
>> c.getU1()
>>
>> I get a null result. If, instead, I had first done
>>
>> c.setP1(somevalue)
>>
>> I would have got the expected result from the getU1() call.
>>
>> The reason why this is happening is that the implementation of getU1() is
>> in the BImpl class; C does not override it. getU1() checks whether p1 is
>> set (eIsSet method), which does not consider the fact that it may be
>> implicitly set by p2 having been set.
>>
>> Does this sound right?
>>
>> I am using UML2 2.1.1 release.
Re: Problem with Property Redefinition and Subsetting [message #626571 is a reply to message #477385] Fri, 16 May 2008 20:12 Go to previous message
Kenn Hussey is currently offline Kenn Hussey
Messages: 1618
Registered: July 2009
Senior Member
James,

I'm not convinced this is a defect, actually - see my reply to Christian.

Kenn

"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:g0fa4e$kn4$1@build.eclipse.org...
> Hi Christian,
>
> At first glance, this does not seem to be a correct implementation.
> Please raise a defect.
>
> Cheers,
> - James.
>
> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:g0f8kk$3gc$1@build.eclipse.org...
>>I have redefined properties, thus:
>>
>> class A
>> - property u1 [0..1] {derived union}
>>
>> class B -> A
>> - property p1 [1] {subsets u1}
>>
>> class C -> B
>> - property p2 [1] {redefines p1}
>>
>> If, given an instance 'c' of C, I to
>>
>> c.setP2(somevalue)
>>
>> and subsequently do
>>
>> c.getU1()
>>
>> I get a null result. If, instead, I had first done
>>
>> c.setP1(somevalue)
>>
>> I would have got the expected result from the getU1() call.
>>
>> The reason why this is happening is that the implementation of getU1() is
>> in the BImpl class; C does not override it. getU1() checks whether p1 is
>> set (eIsSet method), which does not consider the fact that it may be
>> implicitly set by p2 having been set.
>>
>> Does this sound right?
>>
>> I am using UML2 2.1.1 release.
>
>
Re: Problem with Property Redefinition and Subsetting [message #626578 is a reply to message #477391] Sun, 18 May 2008 14:09 Go to previous message
Eclipse User
Originally posted by: cdamus.zeligsoft.com

Thanks, Kenn.

That is exactly how I "worked around" the problem in my model, by
re-specifying the subsetted property.

Glad to know it's not actually a work-around!

cW

On Friday 05-16-2008 (08:11), Kenn Hussey wrote:
> Christian,

> Redefinition in UML follows replacement semantics, so yes, you would
> have to re-specify on p2 all of the characteristics you wish it to
> have (including the fact that it subsets u1).

> Kenn

> "Christian W. Damus" <cdamus@zeligsoft.com> wrote in message
> news:g0f9al$bdl$1@build.eclipse.org...
>> A little more detail:

>> The BImpl::basicGetU1() method checks eIsSet(p1) and delegates to
>> super if not.

>> The p2 redefinition of p1 would be completed by generating a
>> CImpl::basicGetU1() method that checks eIsSet(p2) and delegates to
>> super (i.e., BImpl::basicGetU1() method) if not.

>> It seems that the subset-ness of the redefined property needs to
>> be re-specified on the redefining property in my source model?

>> Cheers,

>> Christian

>> Christian W. Damus wrote:
>>> I have redefined properties, thus:

>>> class A
>>> - property u1 [0..1] {derived union}

>>> class B -> A
>>> - property p1 [1] {subsets u1}

>>> class C -> B
>>> - property p2 [1] {redefines p1}

>>> If, given an instance 'c' of C, I to

>>> c.setP2(somevalue)

>>> and subsequently do

>>> c.getU1()

>>> I get a null result. If, instead, I had first done

>>> c.setP1(somevalue)

>>> I would have got the expected result from the getU1() call.

>>> The reason why this is happening is that the implementation of
>>> getU1() is in the BImpl class; C does not override it. getU1()
>>> checks whether p1 is set (eIsSet method), which does not consider
>>> the fact that it may be implicitly set by p2 having been set.

>>> Does this sound right?

>>> I am using UML2 2.1.1 release.




--

I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
Previous Topic:Re: provide a model with a plugin
Next Topic:Editor shows api generated import twice
Goto Forum:
  


Current Time: Wed Aug 20 16:29:29 EDT 2014

Powered by FUDForum. Page generated in 0.03483 seconds