Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] feature value synchronization
[CDO] feature value synchronization [message #430203] Wed, 13 May 2009 11:50 Go to next message
Martynas  L is currently offline Martynas LFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

I have an EMF feature. The feature value must be "synchronized" with
another non-EMF feature (e.g. simple java class field). The initial idea
was to override eGet, sSet methods to synchronize the values.
Unfortunately these methods are not called when committing/loading the cdo
object.

There are methods cdoInternalPreCommit and cdoInternalPostLoad, but in
another thread I've found that "its calling semantics are not officially
specified and they could change without notice."

Are there any suggestions how such synchronization can be achieved?

In generally what I need is a call to my method when the EMF feature value
is set/get.

Thanks
Re: [CDO] feature value synchronization [message #430204 is a reply to message #430203] Wed, 13 May 2009 11:59 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Martynas,

I think the best way is to register an adapter on the objects to be
synchronized (even if it's only one) and to do the synchronization in
the notifyChaged() method of the adapter implementation. This is the
normal EMF way ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com



Martynas schrieb:
> Hi,
>
> I have an EMF feature. The feature value must be "synchronized" with
> another non-EMF feature (e.g. simple java class field). The initial
> idea was to override eGet, sSet methods to synchronize the values.
> Unfortunately these methods are not called when committing/loading the
> cdo object.
>
> There are methods cdoInternalPreCommit and cdoInternalPostLoad, but in
> another thread I've found that "its calling semantics are not
> officially specified and they could change without notice."
>
> Are there any suggestions how such synchronization can be achieved?
>
> In generally what I need is a call to my method when the EMF feature
> value is set/get.
>
> Thanks
>
>


Re: [CDO] feature value synchronization [message #430205 is a reply to message #430204] Wed, 13 May 2009 12:02 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Eike Stepper schrieb:
> Martynas,
>
> I think the best way is to register an adapter on the objects to be
> synchronized (even if it's only one) and to do the synchronization in
> the notifyChaged() method of the adapter implementation. This is the
> normal EMF way ;-)
>
I forgot to mention that you might want to add a CDO change subscription
policy if you need the exact deltas inside of your adpater implementations.

This FAQ entry could be helpful:
http://wiki.eclipse.org/FAQ_for_CDO_and_Net4j#How_can_I_reac t_to_remote_changes_to_my_objects.3F

And this N&N entry as well:
http://wiki.eclipse.org/New_And_Noteworthy_for_CDO_2.0#Chang e_subscription

Cheers
/Eike

----
http://thegordian.blogspot.com


> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> Martynas schrieb:
>
>> Hi,
>>
>> I have an EMF feature. The feature value must be "synchronized" with
>> another non-EMF feature (e.g. simple java class field). The initial
>> idea was to override eGet, sSet methods to synchronize the values.
>> Unfortunately these methods are not called when committing/loading the
>> cdo object.
>>
>> There are methods cdoInternalPreCommit and cdoInternalPostLoad, but in
>> another thread I've found that "its calling semantics are not
>> officially specified and they could change without notice."
>>
>> Are there any suggestions how such synchronization can be achieved?
>>
>> In generally what I need is a call to my method when the EMF feature
>> value is set/get.
>>
>> Thanks
>>
>>
>>


Re: [CDO] feature value synchronization [message #430254 is a reply to message #430205] Thu, 14 May 2009 10:14 Go to previous messageGo to next message
Martynas  L is currently offline Martynas LFriend
Messages: 16
Registered: July 2009
Junior Member
Hi,

Adapter just partly solves the problem.

Suppose I have an attribute ID, which must be registered somewhere when
the object is loaded.
As loading does not set any feature, the adapter is not notified.
Is there any listener I can register to know the object is loaded.
Overriding InternalCDOLoadable.cdoInternalPostLoad() does not seem to be a
proper way.

Thanks,
Martynas
Re: [CDO] feature value synchronization [message #430257 is a reply to message #430254] Thu, 14 May 2009 10:50 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Martynas,

I fear we have no load notification available so far (Simon, do I miss
something?).
It could make a valid enhancement request. I could imagine something
more general:

CDOStateChangeEvents fired by a CDOView for all associated objects,
triggered by the CDOStateMachine.

Cheers
/Eike

----
http://thegordian.blogspot.com



Martynas schrieb:
> Hi,
>
> Adapter just partly solves the problem.
>
> Suppose I have an attribute ID, which must be registered somewhere
> when the object is loaded.
> As loading does not set any feature, the adapter is not notified.
> Is there any listener I can register to know the object is loaded.
> Overriding InternalCDOLoadable.cdoInternalPostLoad() does not seem to
> be a proper way.
>
> Thanks,
> Martynas
>


Re: [CDO] feature value synchronization [message #430320 is a reply to message #430257] Thu, 14 May 2009 19:58 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
No you didn't miss something, at the moment we do not have any load
notification.

Simon


Eike Stepper wrote:
> Martynas,
>
> I fear we have no load notification available so far (Simon, do I miss
> something?).
> It could make a valid enhancement request. I could imagine something
> more general:
>
> CDOStateChangeEvents fired by a CDOView for all associated objects,
> triggered by the CDOStateMachine.
>
> Cheers
> /Eike
>
> ----
> http://thegordian.blogspot.com
>
>
>
> Martynas schrieb:
>> Hi,
>>
>> Adapter just partly solves the problem.
>>
>> Suppose I have an attribute ID, which must be registered somewhere
>> when the object is loaded.
>> As loading does not set any feature, the adapter is not notified.
>> Is there any listener I can register to know the object is loaded.
>> Overriding InternalCDOLoadable.cdoInternalPostLoad() does not seem to
>> be a proper way.
>>
>> Thanks,
>> Martynas
>>
Re: [CDO] feature value synchronization [message #430383 is a reply to message #430320] Tue, 19 May 2009 13:19 Go to previous messageGo to next message
Martynas  L is currently offline Martynas LFriend
Messages: 16
Registered: July 2009
Junior Member
Is it planned to implement such load/CDOStateChange notification?
This enhancement is important for our project.

Regards,
Martynas
Re: [CDO] feature value synchronization [message #430384 is a reply to message #430383] Tue, 19 May 2009 13:30 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Martynas,

Please file an enhancement request ;-)

Cheers
/Eike

----
http://thegordian.blogspot.com



Martynas schrieb:
> Is it planned to implement such load/CDOStateChange notification?
> This enhancement is important for our project.
>
> Regards,
> Martynas
>


Previous Topic:Teneo (EMF/Hibernate)
Next Topic:UML -> Ecore (Derived + Composite)
Goto Forum:
  


Current Time: Tue Apr 23 07:11:29 GMT 2024

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

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

Back to the top