Re: PreparedStatement parameters and mutable objects

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: PreparedStatement parameters and mutable objects
Дата
Msg-id 1073959652.1145.23.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: PreparedStatement parameters and mutable objects  (Oliver Jowett <oliver@opencloud.com>)
Список pgsql-jdbc
On Mon, 2004-01-12 at 17:44, Oliver Jowett wrote:
> Dave Cramer wrote:
> > Oliver,
> >
> > I think finding the "offical" word on this is going to be unlikely, at
> > best it will be someone's opinion. It's not in the spec so it will be an
> > interpretation. I think more important is meeting the expected behaviour
> > from the users POV.
>
> I've sent an email asking for clarification to the feedback address in
> the 3.0 specification. Hopefully whatever response I get will make it
> into future versions of the JDBC specification.
Ok, lets see what they say.
>
> > That being said, my example showing mutable objects and the expected
> > behaviour was just that an example, I think the behaviour should be the
> > same for mutable/un-mutable objects. I would expect there would be a
> > population of programmers out there that isn't even aware of the fact
> > that some objects are un-mutable/mutable. Unfortunately we need to code
> > to the lowest common denominator.
>
> Ouch. Pass-by-reference semantics are pretty fundamental to Java. Do we
> really have to assume that our users aren't aware of this?

This is essentially what Andrew Rawnsley was referring to in his post
where he said
"Ambiguity tends to have to favor the idiot, unfortunately"

>
> BTW the behaviour for mutable vs. immutable objects *will* be the same
> .. it's just that for immutable objects, they don't happen to expose an
> interface that allows you to change their value (that's why you call
> them immutable ;). The reference semantics are identical.
>
> -O
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>
--
Dave Cramer
519 939 0336
ICQ # 1467551


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: PreparedStatement parameters and mutable objects
Следующее
От: "Iain"
Дата:
Сообщение: getting JDBC connection working