You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Oliver Heger <ol...@oliver-heger.de> on 2012/12/05 22:06:06 UTC

[beanutils] Property access on a fluent API

Hi all,

in [configuration] [beanutils] is used to initialize properties of Java 
objects defined in configuration files. This works fine as long as the 
objects conform to the Java Beans specification.

Now I would like to initialize other objects, too, which implement a 
fluent interface as follows:

class Param {
     public Param setFoo(String value) {
         ...
     }
}

Such properties are not detected by [beanutils] with its standard 
mechanism. As a work-around, I currently provide specific BeanInfo 
classes for the affected Java objects I want to process. They use a 
mechanism which scans a class's methods and adds property descriptors 
for set methods even if they have a non-void return type.

Because fluent APIs like that are becoming more and more popular I 
wonder whether it would be a good extension for [beanutils] to be more 
flexible when searching for property access methods. I guess, 
ultimately, I am asking for an extension point where a custom 
introspection mechanism can be plugged in so that client code is free to 
provide additional property descriptors for its data objects.

Would there be interest to add such a feature to [beanutils]? For 
version 1.x or 2.0?
Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [beanutils] Property access on a fluent API

Posted by Benedikt Ritter <be...@gmail.com>.
2012/12/6 Oliver Heger <ol...@oliver-heger.de>

> Am 05.12.2012 23:13, schrieb Benedikt Ritter:
>
>  Hi Oliver,
>>
>> AFAIK beanutils is not restricted to pure JavaBeans. The project website
>> just says that the component provides simple wrappers around the java
>> refelct and introspect API. So I would say, that the functionality you
>> propsed would fit nicely into BU (maybe the scope has changed and now the
>> name is a bit misleading?!).
>>
>> Regarding your question where to implement it: I did some work on
>> beanutils
>> 2, but there are several outstanding issues on JIRA that block me from
>> providing more patches. So development is a bit stuck until someone can
>> step in and review those issues and the patches attached to them.
>> After that, there are a some points to address before BU2 can be promoted
>> to proper and eventually be released [1].
>> So if you need that functionality quickly, it would probably be easier to
>> add it to BU1 and push out a release.
>>
>
> Thanks,
>
> it is not that urgent because [configuration] is currently undergoing a
> redesign for the 2.0 version which will take some time. I hope to find some
> cycles in the near future to provide a patch with the proposed feature for
> [beanutils].
>

Okay, I guess that I'll be able to adapt your patch for [beanutils2].


>
> Unfortunately, there does not seem to be much interest in this component
> currently.
>

Sadly that's true :-)

Benedikt


>
> Oliver
>
>
>> Regards,
>> Benedikt
>>
>> [1] http://markmail.org/thread/**5zgoyid5ld7otwsv<http://markmail.org/thread/5zgoyid5ld7otwsv>
>>
>>
>> 2012/12/5 Oliver Heger <ol...@oliver-heger.de>
>>
>>  Hi all,
>>>
>>> in [configuration] [beanutils] is used to initialize properties of Java
>>> objects defined in configuration files. This works fine as long as the
>>> objects conform to the Java Beans specification.
>>>
>>> Now I would like to initialize other objects, too, which implement a
>>> fluent interface as follows:
>>>
>>> class Param {
>>>      public Param setFoo(String value) {
>>>          ...
>>>      }
>>> }
>>>
>>> Such properties are not detected by [beanutils] with its standard
>>> mechanism. As a work-around, I currently provide specific BeanInfo
>>> classes
>>> for the affected Java objects I want to process. They use a mechanism
>>> which
>>> scans a class's methods and adds property descriptors for set methods
>>> even
>>> if they have a non-void return type.
>>>
>>> Because fluent APIs like that are becoming more and more popular I wonder
>>> whether it would be a good extension for [beanutils] to be more flexible
>>> when searching for property access methods. I guess, ultimately, I am
>>> asking for an extension point where a custom introspection mechanism can
>>> be
>>> plugged in so that client code is free to provide additional property
>>> descriptors for its data objects.
>>>
>>> Would there be interest to add such a feature to [beanutils]? For version
>>> 1.x or 2.0?
>>> Oliver
>>>
>>> ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.**apac**he.org<http://apache.org>
>>> <de...@commons.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>>
>>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Re: [beanutils] Property access on a fluent API

Posted by Oliver Heger <ol...@oliver-heger.de>.
Am 05.12.2012 23:13, schrieb Benedikt Ritter:
> Hi Oliver,
>
> AFAIK beanutils is not restricted to pure JavaBeans. The project website
> just says that the component provides simple wrappers around the java
> refelct and introspect API. So I would say, that the functionality you
> propsed would fit nicely into BU (maybe the scope has changed and now the
> name is a bit misleading?!).
>
> Regarding your question where to implement it: I did some work on beanutils
> 2, but there are several outstanding issues on JIRA that block me from
> providing more patches. So development is a bit stuck until someone can
> step in and review those issues and the patches attached to them.
> After that, there are a some points to address before BU2 can be promoted
> to proper and eventually be released [1].
> So if you need that functionality quickly, it would probably be easier to
> add it to BU1 and push out a release.

Thanks,

it is not that urgent because [configuration] is currently undergoing a 
redesign for the 2.0 version which will take some time. I hope to find 
some cycles in the near future to provide a patch with the proposed 
feature for [beanutils].

Unfortunately, there does not seem to be much interest in this component 
currently.

Oliver

>
> Regards,
> Benedikt
>
> [1] http://markmail.org/thread/5zgoyid5ld7otwsv
>
>
> 2012/12/5 Oliver Heger <ol...@oliver-heger.de>
>
>> Hi all,
>>
>> in [configuration] [beanutils] is used to initialize properties of Java
>> objects defined in configuration files. This works fine as long as the
>> objects conform to the Java Beans specification.
>>
>> Now I would like to initialize other objects, too, which implement a
>> fluent interface as follows:
>>
>> class Param {
>>      public Param setFoo(String value) {
>>          ...
>>      }
>> }
>>
>> Such properties are not detected by [beanutils] with its standard
>> mechanism. As a work-around, I currently provide specific BeanInfo classes
>> for the affected Java objects I want to process. They use a mechanism which
>> scans a class's methods and adds property descriptors for set methods even
>> if they have a non-void return type.
>>
>> Because fluent APIs like that are becoming more and more popular I wonder
>> whether it would be a good extension for [beanutils] to be more flexible
>> when searching for property access methods. I guess, ultimately, I am
>> asking for an extension point where a custom introspection mechanism can be
>> plugged in so that client code is free to provide additional property
>> descriptors for its data objects.
>>
>> Would there be interest to add such a feature to [beanutils]? For version
>> 1.x or 2.0?
>> Oliver
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [beanutils] Property access on a fluent API

Posted by Benedikt Ritter <be...@gmail.com>.
Hi Oliver,

AFAIK beanutils is not restricted to pure JavaBeans. The project website
just says that the component provides simple wrappers around the java
refelct and introspect API. So I would say, that the functionality you
propsed would fit nicely into BU (maybe the scope has changed and now the
name is a bit misleading?!).

Regarding your question where to implement it: I did some work on beanutils
2, but there are several outstanding issues on JIRA that block me from
providing more patches. So development is a bit stuck until someone can
step in and review those issues and the patches attached to them.
After that, there are a some points to address before BU2 can be promoted
to proper and eventually be released [1].
So if you need that functionality quickly, it would probably be easier to
add it to BU1 and push out a release.

Regards,
Benedikt

[1] http://markmail.org/thread/5zgoyid5ld7otwsv


2012/12/5 Oliver Heger <ol...@oliver-heger.de>

> Hi all,
>
> in [configuration] [beanutils] is used to initialize properties of Java
> objects defined in configuration files. This works fine as long as the
> objects conform to the Java Beans specification.
>
> Now I would like to initialize other objects, too, which implement a
> fluent interface as follows:
>
> class Param {
>     public Param setFoo(String value) {
>         ...
>     }
> }
>
> Such properties are not detected by [beanutils] with its standard
> mechanism. As a work-around, I currently provide specific BeanInfo classes
> for the affected Java objects I want to process. They use a mechanism which
> scans a class's methods and adds property descriptors for set methods even
> if they have a non-void return type.
>
> Because fluent APIs like that are becoming more and more popular I wonder
> whether it would be a good extension for [beanutils] to be more flexible
> when searching for property access methods. I guess, ultimately, I am
> asking for an extension point where a custom introspection mechanism can be
> plugged in so that client code is free to provide additional property
> descriptors for its data objects.
>
> Would there be interest to add such a feature to [beanutils]? For version
> 1.x or 2.0?
> Oliver
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@commons.**apache.org<de...@commons.apache.org>
> For additional commands, e-mail: dev-help@commons.apache.org
>
>