commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arun Thomas" <arun.tho...@paybytouch.com>
Subject RE: [beanutils] some ideas
Date Tue, 07 Oct 2003 22:35:01 GMT
You're right.... Walking up the inheritance heirarchy only makes sense on the "from class"
side.  Walking DOWN the inheritance heirarchy would actually do well on the "to class" side
I think, but, of course, that's much more difficult to do.  
 
In short, the result of the conversion must be the desired class, or a descendant of the desired
class so that casting can succeed.  
 
-AMT

	-----Original Message----- 
	From: Henri Yandell [mailto:bayard@generationjava.com] 
	Sent: Tue 10/7/2003 9:57 AM 
	To: Jakarta Commons Developers List 
	Cc: 
	Subject: Re: [beanutils] some ideas
	
	


	Okay, I suck on doing things 'tonight' :)
	
	Have been playing with the code though, as it's fun stuff. How are you
	feeling about drafting up the proposal etc Matt?
	
	One problem I've hit is that inheritence is kind of useless. You'll just
	get a ClassCast in most usages:
	
	Converter converter = ConverterRegistry.getConverter(String.class,
	java.sql.Date.class);
	
	preparedStatement.setDate(1, converter.convert(java.sql.Date.class,
	someString) );
	
	If there's no sql.Date converter, it then finds a util.Date converter.
	Converts and promptly dies. Inheritence on the fromClass side may still
	make sense. For most people, this basically means Object->String.
	
	Hen
	
	On Mon, 29 Sep 2003, Henri Yandell wrote:
	
	>
	> I have a [convert] sitting on my laptop that I can commit into the
	> sandbox tonight. It's just an extraction of tests/src from beanutils. I
	> wasn't sure if that was the right way to go.
	>
	> Hen
	>
	> On Mon, 29 Sep 2003, Sgarlata Matt wrote:
	>
	> > +1.
	> >
	> > Is someone going to step up and create the new [convert] sandbox component?
	> > I am not a committer, so I don't think I can help here.  I would like to
	> > volunteer to draft the mandate for the project, which would basically
	> > summarize the issues discussed in this thread.
	> >
	> > Matt
	> > ----- Original Message -----
	> > From: "Henri Yandell" <bayard@generationjava.com>
	> > To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
	> > Sent: Monday, September 29, 2003 12:53 AM
	> > Subject: Re: [beanutils] some ideas
	> >
	> >
	> > >
	> > >
	> > > On Sun, 28 Sep 2003, Sgarlata Matt wrote:
	> > >
	> > > > From: "Henri Yandell" <bayard@generationjava.com>
	> > > >
	> > > > > > Can anyone think of any others?
	> > >
	> > > Something that would need deciding is what to do when the 'from' and the
	> > > 'to' classes are the same. Should a String->String converter be looked
	> > > for, or should it optimise it away.
	> > >
	> > > I suspect that there just shouldn't be any identity converters
	> > > pre-registered, but people can always put them in if they wish to.
	> > >
	> > > Hen
	> > >
	> > >
	> > > ---------------------------------------------------------------------
	> > > 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
	>
	
	
	---------------------------------------------------------------------
	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