Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [DataBinding] Using JFace DB for Mapping Object Models
[DataBinding] Using JFace DB for Mapping Object Models [message #325372] Fri, 15 February 2008 13:58 Go to next message
Eclipse UserFriend
Originally posted by: housh_housh.yahoo.com

Hello,

JFace DB is usually used for mapping between UI and Model. Is it
possible to used this automatic mapping for this situation:

I have a client-domain-model on an rcp-client. This client-domain-model
is very similar to the domain-model on the ejb-serverside (implemented
with jpa-entities). It is similar, but not exactly the same.

Now everytime I want to sync with the serverside I need some kind of
mapping-mechanism between some two objects "Customer" on the client and
"CustomerEntity" on the server.

Am I thinking in the right direction, that I can somehow use JFace DB
for this problem? If J DB is suited, what do I have to do - implement
any interfaces of Jface DB for the model objects or so?

Could you please give me some specific hints on that?

Thank you very much.
Best,
ex
Re: [DataBinding] Using JFace DB for Mapping Object Models [message #325383 is a reply to message #325372] Fri, 15 February 2008 17:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

exquisitus wrote:
> Hello,
>
> JFace DB is usually used for mapping between UI and Model. Is it
> possible to used this automatic mapping for this situation:
>
> I have a client-domain-model on an rcp-client. This client-domain-model
> is very similar to the domain-model on the ejb-serverside (implemented
> with jpa-entities). It is similar, but not exactly the same.
>
> Now everytime I want to sync with the serverside I need some kind of
> mapping-mechanism between some two objects "Customer" on the client and
> "CustomerEntity" on the server.
>
> Am I thinking in the right direction, that I can somehow use JFace DB
> for this problem? If J DB is suited, what do I have to do - implement
> any interfaces of Jface DB for the model objects or so?
>
> Could you please give me some specific hints on that?

Didn't you ask the same question on the eclipse.newcomer group
yesterday? Please see my response there.

Eric
Re: [DataBinding] Using JFace DB for Mapping Object Models [message #325385 is a reply to message #325383] Fri, 15 February 2008 18:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: housh_housh.yahoo.com

Eric Rizzo wrote:
> exquisitus wrote:
>> Hello,
>>
>> JFace DB is usually used for mapping between UI and Model. Is it
>> possible to used this automatic mapping for this situation:
>>
>> I have a client-domain-model on an rcp-client. This client-domain-model
>> is very similar to the domain-model on the ejb-serverside (implemented
>> with jpa-entities). It is similar, but not exactly the same.
>>
>> Now everytime I want to sync with the serverside I need some kind of
>> mapping-mechanism between some two objects "Customer" on the client and
>> "CustomerEntity" on the server.
>>
>> Am I thinking in the right direction, that I can somehow use JFace DB
>> for this problem? If J DB is suited, what do I have to do - implement
>> any interfaces of Jface DB for the model objects or so?
>>
>> Could you please give me some specific hints on that?
>
> Didn't you ask the same question on the eclipse.newcomer group
> yesterday? Please see my response there.
>
> Eric


Hi Eric,

yes I did.
I was hoping to get a little more help here since I didn't exactly
understand your answer.

Could you please be a litte more precise.
Thanx,
ex
Re: [DataBinding] Using JFace DB for Mapping Object Models [message #325388 is a reply to message #325385] Fri, 15 February 2008 19:33 Go to previous message
Eclipse UserFriend
exquisitus wrote:
> Eric Rizzo wrote:
>> exquisitus wrote:
>>> Hello,
>>>
>>> JFace DB is usually used for mapping between UI and Model. Is it
>>> possible to used this automatic mapping for this situation:
>>>
>>> I have a client-domain-model on an rcp-client. This client-domain-model
>>> is very similar to the domain-model on the ejb-serverside (implemented
>>> with jpa-entities). It is similar, but not exactly the same.
>>>
>>> Now everytime I want to sync with the serverside I need some kind of
>>> mapping-mechanism between some two objects "Customer" on the client and
>>> "CustomerEntity" on the server.
>>>
>>> Am I thinking in the right direction, that I can somehow use JFace DB
>>> for this problem? If J DB is suited, what do I have to do - implement
>>> any interfaces of Jface DB for the model objects or so?
>>>
>>> Could you please give me some specific hints on that?
>> Didn't you ask the same question on the eclipse.newcomer group
>> yesterday? Please see my response there.
>>
>> Eric
>
>
> Hi Eric,
>
> yes I did.
> I was hoping to get a little more help here since I didn't exactly
> understand your answer.
>
> Could you please be a litte more precise.
> Thanx,
> ex

The answer is yes, you can bind model-to-model in DataBinding just as
well as binding model-to-UI.

What I suggest is that you go through your model classes and make sure
the following patterns are followed:
* Use get/set method names for property accessor and mutator methods.
* They should implement the following methods:
addPropertyChangeListener(PropertyChangeListener)
removePropertyChangeListener(PropertyChangeListener)
addPropertyChangeListener(
String propertyName, PropertyChangeListener)
removePropertyChangeListener(
String propertyName, PropertyChangeListener)

With these methods in place, BeansObservables will be able to monitor
your model objects for changes, so that when one side of the model
changes, the other side can be updated accordingly.

Hope this helps,

Matthew
Previous Topic:Using scp task in ant build file
Next Topic:MessageDialog raises a NullPointerException
Goto Forum:
  


Current Time: Wed Jul 16 16:56:39 EDT 2025

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

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

Back to the top