commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Waldhoff, Rodney" <rwald...@us.britannica.com>
Subject RE: [Latka] Developer's Guide / Coding Style
Date Fri, 22 Mar 2002 16:29:21 GMT
Right. I said that four emails ago.

-----Original Message-----
From: ringo.desmet@mediagenix.com [mailto:ringo.desmet@mediagenix.com]
Sent: Friday, March 22, 2002 10:28 AM
To: commons-dev@jakarta.apache.org
Subject: RE: [Latka] Developer's Guide / Coding Style



>     public void close() throws SQLException {
>        _sourcePool.returnObject(this);
>     }

The public close method is well-defined by the Connection interface, so no
problem here.

>     private void _close() throws SQLException {
>        _delegate.close();
>     }

This method is a bit dubious. If I use a development tool, where I can just
see a list om my methods, I see the two close methods, but I have no clue
whatsoever what the difference with the public version is. In your example,
I would definitely rename the private _close method to closeDelegate or
closeDelegateConnection (without underscore). In that case, one can see the
difference in semantics between the public and private version of the method
very easy.

I think that in all cases you can give your method a better name that
reflects what the method really does.

Ringo

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message