Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 83257 invoked from network); 27 Aug 2003 02:12:55 -0000 Received: from unknown (HELO umbongo.flamefew.net) (64.253.103.114) by daedalus.apache.org with SMTP; 27 Aug 2003 02:12:55 -0000 Received: by umbongo.flamefew.net (Postfix on Linux (i386), from userid 500) id D3FF2195C; Tue, 26 Aug 2003 21:52:40 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by umbongo.flamefew.net (Postfix on Linux (i386)) with ESMTP id AE47D191F for ; Tue, 26 Aug 2003 21:52:40 -0400 (EDT) Date: Tue, 26 Aug 2003 21:52:40 -0400 (EDT) From: Henri Yandell X-X-Sender: hen@umbongo.flamefew.net To: Jakarta Commons Users List Subject: Re: [BeanUtils] ConvertUtils.convert too restrictive? In-Reply-To: <003101c36c33$dd47ada0$74778051@oemcomputer> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I think it should. How is [convert] different to a Transformer? Hen On Wed, 27 Aug 2003, Stephen Colebourne wrote: > Maybe we should consider a new [convert] project at commons? Just a thought. > > Stephen > > From: "robert burrell donkin" > To: "Jakarta Commons Users List" > Sent: Tuesday, August 26, 2003 11:01 PM > Subject: Re: [BeanUtils] ConvertUtils.convert too restrictive? > > > > hi scott > > > > (you seem in a very argumentative mood. i'll try to avoid taking the bait. > > ) > > > > On Tuesday, August 26, 2003, at 09:57 PM, Scott Howlett wrote: > > > > > Why does this function: > > > > > > ConvertUtils.convert(String value, Class type) > > > > > > require a String argument? All it does is dispatch to some Converter > > > that can take any Object, so this restriction seems unnecessary. It > > > causes callers to have to convert to string first which may sometimes > > > not be desirable. > > > > i suspect that the reason for this is that ConvertUtils was designed to > > handle string to object conversions (rather than object-to-object ones). > > when examined from this perspective, the signature is very reasonable. > > > > > In particular this seems to cause problems with BeanUtils.setProperty(). > > > I asked the same question in a comment on this bug: > > > > > > http://issues.apache.org/bugzilla/show_bug.cgi?id=16525 > > > > > > but I haven't heard anything. > > > > the beanutils bug lists have a very large backlog. > > > > the issue boils down to the fact that ConvertUtils is design to perform > > string-to-object conversions rather than more general object-to-object > > conversions. i'd say that the most satisfactory to solve both your problem > > and the more general issue would be to subclass PropertyUtilBean or add a > > pluggable strategy which would allow any compliant implementation to be > > used. > > > > > Oh - while I'm asking, why do Converter objects bother taking a type > > > argument at all? None of the converters I looked at bother to use it - > > > they just assume they're converting to the type they were registered > > > for. If this usage is widespread, perhaps a new version without the type > > > argument ought to be created and the existing one deprecated. > > > > setting aside that this is not going to happen (due to backward > > compatibility issues), just because most people don't use a particular > > feature doesn't mean that it should be removed. i know that there are > > users who use this feature. whatever the faults that beanutils exhibits, > > thankfully the code isn't so bloated yet that we need to consider removing > > features used only by minorities. > > > > - robert > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >