maybe it's time to think about adding an optional package (org.apache.commons.beantuils.optional?) and a build for a beanutils-optional.jar inspired by the way that ant manages non-core dependencies. this would allow new implementations with dependencies to be added to the component without adding to the core-dependencies of beanutils.

- robert

On Thursday, June 12, 2003, at 11:33 PM, Steven Caswell wrote:

My use of the lang.builder is in fact the non-reflection part. I simply look
at the dynabean's dynaclass, ask it for the array of dyna properties, then
step through the array and call gets on the dynabean for each property,
passing the result to the appropriate builder.


I understand any hesitancy to add an external dependency without good
reason. Of course IMHO, adding a dependency to lang would be appropriate
here because of the benefits of having this basic functionality encapsulated
in the lang.builder package. While the implementation of toString and equals
could be redone without lang.builder, it would be more work (which would be
more error-proned) to do a hashCode implementation in a similar manner. I
think it would be a shame to waste the great effort of the lang folks who
put together the lang.builder package.


I use many of the pieces on a daily basis, esp. the lang.builder stuff. IMHO
it is pretty solid, so I think the risk to beanutils of a dependency on lang
would be minimal.



Steven Caswell [EMAIL PROTECTED] a.k.a Mungo Knotwise of Michel Delving "One ring to rule them all, one ring to find them..."


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 3:08 AM
To: Jakarta Commons Developers List
Subject: Re: [beanutils] extending BasicDynaBean with
toString, equals, and hashCode


The concept of ToStringBuilder and EqualsBuilder ist good, but not completely suited for BeanUtils - the reflection pattern used does not consider the accessor methods for beans.

If your extended dynabean does the explicit use of the
lang.builder code w/o the reflection parts, it should suite
the bean use pattern. A dependency of beanutils on lang will
need acceptance voting from the committers (to me seems to be
OK, since lang is even lower level than beans).

It might be sensible to factor out parts from the
lang.builder implementations to be then subclassed once for
beans and once for full filed reflection usage?

Just my 2c!

Craig R. McClanahan wrote:

On Tue, 3 Jun 2003, Steven Caswell wrote:



Date: Tue, 3 Jun 2003 20:32:26 -0400
From: Steven Caswell <[EMAIL PROTECTED]>
Reply-To: Jakarta Commons Developers List
<[EMAIL PROTECTED]>,
    [EMAIL PROTECTED]
To: Jakarta Commons Developers List <[EMAIL PROTECTED]>
Subject: [beanutils] extending BasicDynaBean with toString, equals,
    and hashCode

I've written an extended dynabean class that extends
(actually, wraps)
BasicDynaBean to add toString and equals. The toString method uses
commons.lang.ToStringBuilder to build the toString, and
commons.lang.EqualsBuilder to perform the equals
comparison. I know it
needs hashCode, I just haven't taken the time to add it yet.

Is there any interest in having this class donated to
commons-beanutils?



Conceptually, I like the idea.  My only concern is that it would
introduce a dependency on commons-lang that does not
currently exist
in beanutils.


Steven Caswell


Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- :) Christoph Reck





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to