You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Henri Yandell <ba...@generationjava.com> on 2003/10/07 18:57:13 UTC

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" <ba...@generationjava.com>
> > To: "Jakarta Commons Developers List" <co...@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" <ba...@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


Re: [beanutils] some ideas

Posted by Henri Yandell <ba...@generationjava.com>.

On Tue, 7 Oct 2003, Sgarlata Matt wrote:

> Hi Henri,
>
> The past week has been insane, but I can commit to putting together the
> [convert] proposal this week since it shouldn't take long.

No worries.

> > 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.
>
> Why does it die, and what do you mean by 'die'?

die as in, the idea dies. People will try to cast it immediately and get
ClassCasts. So I'm struggling to see the advantage to the inheritence
lookup. It's implemented though, so can happily commit it.

Hen

> ----- Original Message -----
> From: "Henri Yandell" <ba...@generationjava.com>
> To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
> Sent: Tuesday, October 07, 2003 12:57 PM
> 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" <ba...@generationjava.com>
> > > > To: "Jakarta Commons Developers List" <co...@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" <ba...@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
> >
>
>
> ---------------------------------------------------------------------
> 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


Re: [beanutils] some ideas

Posted by Sgarlata Matt <sg...@bah.com>.
Hi Henri,

The past week has been insane, but I can commit to putting together the
[convert] proposal this week since it shouldn't take long.

> 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.

Why does it die, and what do you mean by 'die'?

Matt
----- Original Message ----- 
From: "Henri Yandell" <ba...@generationjava.com>
To: "Jakarta Commons Developers List" <co...@jakarta.apache.org>
Sent: Tuesday, October 07, 2003 12:57 PM
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" <ba...@generationjava.com>
> > > To: "Jakarta Commons Developers List" <co...@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" <ba...@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
>


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