commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory" <ggreg...@seagullsw.com>
Subject RE: Proposal for the Commons Sandbox
Date Mon, 08 Mar 2004 20:23:25 GMT
In this case you are building a java.lang.String. Simple answer eh? ;-)

The [Reflection]ToStringBuilder is used to create a String based on
other Objects. The most common usage is to implement an Object's
toString() method with a [Reflection]ToStringBuilder. You can also use
the string builder classes to build a String for any object of course. 

For example, it can be useful for debugging purposes to use a
ReflectionToStringBuilder toString to dump the contents of an arbitrary
object.

For the package as a whole, the term builder applies to the notion of
building different kinds of algorithms for us with toString(), equals(),
compareTo(), and hashCode(). Builder might not be a great name but it is
hard to think of a name that says: "Assits in overriding methods that
are in Object: toString(), hashCode(), equals(), and also compareTo()."

Gary

> -----Original Message-----
> From: David Gilliland [mailto:dgilliland62@users.sourceforge.net]
> Sent: Monday, March 08, 2004 11:13
> To: Jakarta Commons Developers List
> Subject: RE: Proposal for the Commons Sandbox
> 
> Yes, I think Jestr could be incorporated cleanly into the
ToStringBuilder
> hierarchy, either as a subclass of ToStringBuilder, or as a subclass
of
> ReflectionToStringBuilder.
> 
> I would be happy to incorporate it into
org.apache.commons.lang.builder,
> but there's just something about this categorization that bugs me a
> little:  Isn't the term "builder" a bit misleading here?  After all,
Jestr
> doesn't really care if I am building a toString() method or not, and
if I
> am stringifying some legacy or third party class, then what exactly am
I
> "building"?
> 
> ---------- Original Message ----------------------------------
> From: "Gary Gregory" <ggregory@seagullsw.com>
> Reply-To: "Jakarta Commons Developers List" <commons-
> dev@jakarta.apache.org>
> Date:  Mon, 8 Mar 2004 13:43:51 -0500
> 
> >Hello,
> >
> >> However I think Jestr is a
> >> little different from the ToStringBuilder stuff because it isn't
> >> necessarily concerned with helping you implement toString()
methods;
> >> instead, it's more concerned with helping you log *arbitrary*
objects,
> >> even if you don't have access to their source code to change their
> >> toString() methods.
> >
> >Note that the o.a.c.l.builder package also provides the ability to
> >operate on an arbitrary object. Please see:
> >
> >(1) The class ReflectionToStringBuilder:
> >
>
>http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/buil
d
> >er/ReflectionToStringBuilder.html
> >
> >(2) The ToStringBuilder methods which forward to
> >ReflectionToStringBuilder:
> >
>
>http://jakarta.apache.org/commons/lang/api/org/apache/commons/lang/buil
d
> >er/ToStringBuilder.html#reflectionToString(java.lang.Object)
> >
> >Gary
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 



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


Mime
View raw message