Strongly typed databinding? [message #534092] |
Mon, 17 May 2010 21:23  |
Eclipse User |
|
|
|
Is there a way to have more strongly typed databinding? Right now I have
something like using the eclipse.core.databinding package:
PojoObservables.observeValue(this.personModel, "name");
But if the name attribute (getName method) changes to firstName
(getFirstName) for example, I would not know until runtime that there is an
error.
My model is a JAXB created one.
- Ken
|
|
|
|
Re: Strongly typed databinding? [message #534702 is a reply to message #534116] |
Wed, 19 May 2010 23:52  |
Eclipse User |
|
|
|
Tom, thanks that make sense. Thanks for your pointers.
- Ken
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:hste1g$p0m$1@build.eclipse.org...
> Hi,
>
> No because Java doesn't have a concept of Properties. There are 2
> solutions coming to my mind:
>
> a) you create property constants when your model is generated from JAXB
> (not sure if JAXB supports this) so you'd write something like this:
> ----------8<----------
> PojoObservables.observeValue(this.personModel, Person.NAME);
> ----------8<----------
> Which would lead to a compiler error if you regenerate.
>
> b) you use EMF instead of JAXB because EMF generates such property
> constants
>
> Tom
>
> Am 18.05.10 03:23, schrieb Ken Prole:
>> Is there a way to have more strongly typed databinding? Right now I have
>> something like using the eclipse.core.databinding package:
>>
>> PojoObservables.observeValue(this.personModel, "name");
>>
>> But if the name attribute (getName method) changes to firstName
>> (getFirstName) for example, I would not know until runtime that there is
>> an error.
>>
>> My model is a JAXB created one.
>>
>> - Ken
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03127 seconds