You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Guijt, Bart (fin)" <Ba...@ordina.nl> on 2002/02/14 10:34:20 UTC
RE: [BeanUtils] Having a mapped property and indexed property wit
h th e same name
> From: Craig R. McClanahan[SMTP:craigmcc@apache.org]
> On Thu, 14 Feb 2002, Guijt, Bart (fin) wrote:
>
> >
> > My question is: Is this the intended behaviour? My property is both
> mapped
> > and indexed, and using method overloading to support this seems to be
> the
> > right way to do it.
> >
>
> Unfortunately, having overloaded property getters or setters violates the
> JavaBeans spec. I would suggest changing the name of one or the other
> getter to something unique.
>
I did that, as a workaround to this particular 'overloading' problem.
However, I just downloaded and read the spec
(http://java.sun.com/products/javabeans/docs/beans.101.pdf) and the Design
Patterns chapter (8.3) does *not* mention the overloading violation, it only
mentions the patterns expected when using certain types of properties
(simple, collections and indexed). Since Mapped properties are an invention
of the BeanUtils package, I suggest we support them using overloading ;-)
> > - Bart Guijt
> >
>
> Craig McClanahan
>
Bart Guijt
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>