Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF and private fields without getters
GMF and private fields without getters [message #201215] Fri, 08 August 2008 11:09 Go to next message
Eclipse UserFriend
Hi

This question is probably for GMF contributors: why so many GMF classes,
which can be overridden by clients, store values passed to constructors
in private fields without getters? When I override such class I have to
create my own duplicates.

Greetings,
Seweryn
Re: GMF and private fields without getters [message #201326 is a reply to message #201215] Mon, 11 August 2008 05:07 Go to previous messageGo to next message
Eclipse UserFriend
Hello Seweryn,

Can you post here examples of such classes + attributes?
These cases definitely should be fixed...

-----------------
Alex Shatalin
Re: GMF and private fields without getters [message #201594 is a reply to message #201326] Tue, 12 August 2008 08:26 Go to previous messageGo to next message
Eclipse UserFriend
Alex Shatalin wrote:
> Hello Seweryn,
>
> Can you post here examples of such classes + attributes? These cases
> definitely should be fixed...

Unfortunately I'm currently cut off from my source code (vacation) but
AFAIR RepositionEObjectCommand is such class.

Greetings,
Seweryn
Re: GMF and private fields without getters [message #201697 is a reply to message #201594] Wed, 13 August 2008 03:36 Go to previous messageGo to next message
Eclipse UserFriend
Hello Seweryn,

> AFAIR RepositionEObjectCommand is such class.
Wich particular attributes of RepositionEObjectCommand you should be able
to get/set?

-----------------
Alex Shatalin
Re: GMF and private fields without getters [message #201821 is a reply to message #201594] Wed, 13 August 2008 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Seweryn,

Perhaps some of these classes weren't intended to be extended by
subclassing, despite that the documentation doesn't indicate thus?

In any case, extension by composition rather than inheritance may work
especially well for commands. Indeed, the EditHelper framework
basically builds that pattern in via the contribution of advising
commands. There is also the possibility of replacing the core command
using the instead-command facility.

I expect that you have already considered all of this ... :-)

Cheers,

Christian


Seweryn Niemiec wrote:
> Alex Shatalin wrote:
>> Hello Seweryn,
>>
>> Can you post here examples of such classes + attributes? These cases
>> definitely should be fixed...
>
> Unfortunately I'm currently cut off from my source code (vacation) but
> AFAIR RepositionEObjectCommand is such class.
>
> Greetings,
> Seweryn
Re: GMF and private fields without getters [message #202910 is a reply to message #201697] Thu, 21 August 2008 11:22 Go to previous messageGo to next message
Eclipse UserFriend
Alex Shatalin wrote:
> Hello Seweryn,
>
>> AFAIR RepositionEObjectCommand is such class.
> Wich particular attributes of RepositionEObjectCommand you should be
> able to get/set?

displacement :)

--
Greetings
Seweryn
Re: GMF and private fields without getters [message #202938 is a reply to message #202910] Thu, 21 August 2008 13:18 Go to previous messageGo to next message
Eclipse UserFriend
Hello Seweryn,

Loos like you should pass this argument as a parameter.... No need to change
it.

-----------------
Alex Shatalin
Re: GMF and private fields without getters [message #203952 is a reply to message #202938] Mon, 01 September 2008 02:52 Go to previous messageGo to next message
Eclipse UserFriend
Alex Shatalin wrote:
> Hello Seweryn,
>
> Loos like you should pass this argument as a parameter.... No need to
> change it.

This argument is passed as a parameter to the constructor. I override
this constructor and call super to set up the fields, but later in
doExecute...() I can't get them.

The same problem is with AddCommand.

--
Greetings,
Seweryn
Re: GMF and private fields without getters [message #205122 is a reply to message #203952] Wed, 10 September 2008 10:54 Go to previous message
Eclipse UserFriend
Hello Seweryn,

If you need this field value then it's reasonable to have protected accessor
method for it (getDisplacement()). I think i make sense to submit a request
to change this class(es).
For now you can just create one more private field "displacement" in your
subclass, assign proper value to it in a constructor and use it in doExecute..
method.

-----------------
Alex Shatalin
Previous Topic:Accessing data from the ACTIVE tab
Next Topic:Change default drag'n'drop method to Copy
Goto Forum:
  


Current Time: Fri Jun 06 11:12:49 EDT 2025

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

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

Back to the top