Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Base class retrieved value from eStaticClass() method (Same baseclass should be retrieved or its generalized one)
Base class retrieved value from eStaticClass() method [message #1597068] Mon, 02 February 2015 03:49 Go to next message
Basheer Jasser is currently offline Basheer JasserFriend
Messages: 23
Registered: September 2014
Location: University Putra Malaysia...
Junior Member
I'm dealing with E-core diagram where I have meta-class A generalized from meta-class B which in turn generalized from meta-class C. The retrieved baseclass value from "protected EClass eStaticClass(){}" generated method is the class A itself while in other cases using the same meta-model the retrieved value is class C.

The question is "is there something to do so that I control the retrieved baseclass value from eStaticClass method whether it should be the same class A dealt with or the generalized class C ? "

Thanks in advance.
Basheer
Re: Base class retrieved value from eStaticClass() method [message #1597273 is a reply to message #1597068] Mon, 02 February 2015 07:09 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30132
Registered: July 2009
Senior Member
Basheer,

Comments below.

On 02.02.2015 04:49, Basheer Jasser wrote:
> I'm dealing with E-core diagram where I have meta-class A generalized
> from meta-class B which in turn generalized from meta-class C. The
> retrieved baseclass value from "protected EClass eStaticClass(){}"
> generated method is the class A itself while in other cases using the
> same meta-model the retrieved value is class C.
In a generated model's implementation class, it should always be the
EClass being implemented.
> The question is "is there something to do so that I control the
> retrieved baseclass value from eStaticClass method whether it should be
> the same class A dealt with or the generalized class C ? "
I'm not sure if you mean something special by 'baseclass'...
>
> Thanks in advance.
> Basheer
Re: Base class retrieved value from eStaticClass() method [message #1597551 is a reply to message #1597273] Mon, 02 February 2015 11:26 Go to previous messageGo to next message
Basheer Jasser is currently offline Basheer JasserFriend
Messages: 23
Registered: September 2014
Location: University Putra Malaysia...
Junior Member
Ed.,

Comments below.

On 02.02.2015 04:49, Basheer Jasser wrote:
> I'm dealing with E-core diagram where I have meta-class A generalized
> from meta-class B which in turn generalized from meta-class C. The
> retrieved baseclass value from "protected EClass eStaticClass(){}"
> generated method is the class A itself while in other cases using the
> same meta-model the retrieved value is class C.
In a generated model's implementation class, it should always be the
EClass being implemented.

As in this fraction of the diagram in Figure 1 which shows the generalization between different meta-classes , and the generated code in class A which is shown below
------------------------------------------------------------
public class AImpl extends BImpl implements A {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected AImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return MyPackage.Literals.A;
}

} //AImpl
------------------------------------------------------------
So the natural behavior of eStaticClass() is to obtain class A as a returned value and it is not possible to return the generalized meta-class B or C ???

I'm facing some cases in the original project which is giving class C as the returned value ( I don't know why ). So maybe there is something to which is affecting eStaticClass() method behavior to return class C as retrieved value.

> The question is "is there something to do so that I control the
> retrieved baseclass value from eStaticClass method whether it should be
> the same class A dealt with or the generalized class C ? "
I'm not sure if you mean something special by 'baseclass'...

The baseclass is the name of debugger variable which is representing the returned value of eStaticClass() method.



index.php/fa/20701/0/<br />
  • Attachment: test.png
    (Size: 1.98KB, Downloaded 132 times)
Re: Base class retrieved value from eStaticClass() method [message #1598099 is a reply to message #1597551] Mon, 02 February 2015 19:50 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30132
Registered: July 2009
Senior Member
Basheer,

Comments below.


On 02.02.2015 12:26, Basheer Jasser wrote:
> Ed.,
>
> Comments below.
>
> On 02.02.2015 04:49, Basheer Jasser wrote:
>> I'm dealing with E-core diagram where I have meta-class A generalized
>> from meta-class B which in turn generalized from meta-class C. The
>> retrieved baseclass value from "protected EClass eStaticClass(){}"
>> generated method is the class A itself while in other cases using the
>> same meta-model the retrieved value is class C.
> In a generated model's implementation class, it should always be the
> EClass being implemented.
>
> As in this fraction of the diagram in Figure 1 which shows the generalization between different meta-classes , and the generated code in class A which is shown below
> ------------------------------------------------------------
> public class AImpl extends BImpl implements A {
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> protected AImpl() {
> super();
> }
> /**
> * <!-- begin-user-doc -->
> * <!-- end-user-doc -->
> * @generated
> */
> @Override
> protected EClass eStaticClass() {
> return MyPackage.Literals.A;
> }
>
> } //AImpl
> ------------------------------------------------------------
> So the natural behavior of eStaticClass() is to obtain class A as a returned value and it is not possible to return the generalized meta-class B or C ???
Yes, AImpl's eStaticClass must always return A's EClass instance.
>
> I'm facing some cases in the original project which is giving class C as the returned value ( I don't know why ). So maybe there is something to which is affecting eStaticClass() method behavior to return class C as retrieved value.
It seems impossible for a generated model, i.e., eStaticClass() ==
eClas() for instances of generated models. For a dynamic model that
extends a generated model, the two will be different.
>
>> The question is "is there something to do so that I control the
>> retrieved baseclass value from eStaticClass method whether it should be
>> the same class A dealt with or the generalized class C ? "
> I'm not sure if you mean something special by 'baseclass'...
>
> The baseclass is the name of debugger variable which is representing the returned value of eStaticClass() method.
>
>
>
>
Previous Topic:Intermediate properties for EObject ?
Next Topic:Modeling Symposium EclipseCon North America 2015
Goto Forum:
  


Current Time: Wed May 22 11:21:18 GMT 2019

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

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

Back to the top