> One could question if there isn't anything wrong with the naming of the
> methods. Do you have an example of such a scenario that we could use to
> discuss?

Here's an example of what I'm talking about:

public class PooledConnection extends Connection {
    public PooledConnection(Connection delegate) {
        _delegate = delagate;
    }

    public void someMethod() throws SQLException {
        _delegate.someMethod();
    }

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

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

    private Connection _delegate = null;
    private Pool _sourcePool = null;
}

If you're really in tune with an underscore-prefix-on-private-members
convention, that's pretty readable--it's clear that _close() is the private
form of close().  

But I won't try to defend it.  I agree with you. (E.g., in this situation in
dbcp, we used "reallyClose()" in place of "_close()".)  A scenario in which
this would be useful would happen rarely if ever.  That was my whole point,
I don't think it should be considered conventional, and I don't think anyone
has really ever claimed it to be so. (But the Latka coding style doc does.)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 22, 2002 9:52 AM
To: [EMAIL PROTECTED]
Subject: RE: [Latka] Developer's Guide / Coding Style


   
> > private methods also begin with an underscore
> 
> I think I've been known to do this on rare occasions (mainly 
> when there is
> some public method and protected/private method with an 
> otherwise identical
> signature) but I wouldn't claim it to be "conventional" in 
> any sense of the word.

One could question if there isn't anything wrong with the naming of the
methods. Do you have an example of such a scenario that we could use to
discuss?

Ringo

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

Reply via email to