commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Yandell <bay...@generationjava.com>
Subject Re: [beanutils] some ideas
Date Sun, 28 Sep 2003 16:58:26 GMT


On Sun, 28 Sep 2003, Joe Germuska wrote:

> At 22:39 -0400 9/27/03, Henri Yandell wrote:
> >I'm interested in the convert stuff. Especially the Object->String stuff.
> >
> >First a question on Dates. Why not support for java.util.Date? It seems
> >that there's not much point having SqlDateConverter, it should just be
> >DateConverter based on util.Date.
>
> The trick is that there's no universal conventions for formatting
> regular dates as strings, while java.sql.Date has a "valueOf(String)"
> method which adheres to a well-defined format standard.
>
> It's easy enough to write a Converter implementation that is seeded
> with a SimpleDateFormat  pattern-string, but it's also possible that
> you'd need to deal with dates in more than one format, especially if
> you are dealing with times as distinct from dates.
>
> I've worked around with a custom converter as described above, but
> I've never come up with a good solution for a general framework for
> it.

Not convinced by this argument.

1) Dates are just an example here. An especially gruesome example, so
specific issues don't bother me too much.

2) Date.valueOf is as good as DateFormat.format. Both of them make massive
assumptions about the format desired. This just means that people need to
be able to set their own option [and that BeanUtils needs to supply more
than just the default options].

Hen


Mime
View raw message