[DataBinding] Using JFace DB for Mapping Object Models [message #325372] |
Fri, 15 February 2008 13:58  |
Eclipse User |
|
|
|
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 #325388 is a reply to message #325385] |
Fri, 15 February 2008 19:33  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.26353 seconds