I used to be of the opinion that acronyms should be all uppercase. This issue outlined by Dave bit me badly on a couple of projects and now I'm of the opinion that only the initial letter should be capitalized in an an acronym. It just works out better that way with existing Java bean frameworks.

[ ]: All capital
[X]: Only the initial letter should be capital

-Mike

David M. Lloyd wrote:
On Mon, 17 Sep 2007 23:57:11 +0900
"Trustin Lee" <[EMAIL PROTECTED]> wrote:

Hi folks,

As many people pointed out, MINA currently has somewhat inconsistent
naming style for acronyms (e.g IO vs Io and MDC vs Mdc).  I'm not sure
standardizing the naming style for acronyms are definitely required,
but I'd like to know what you think about it.

Personally I'd prefer all capital acronym because it's what acronym
is, and IOException is already a good example. :)

Think about this though.  Say I've got a class called IPAddress.
Consider this:

public class Foo {
    private IPAddress ipAddress;

    public void setIPAddress(IPAddress ipAddress) { this.ipAddress = ipAddress; 
}

    public IPAddress getIPAddress(IPAddress ipAddress) { return ipAddress; }

    // other stuff...
}

Many frameworks will expect that, given a property name of "ipAddress", there
will be a getter/setter of "getIpAddress/setIpAddress".  To use the "proper"
names, you'd need a property of name "iPAdress", which looks ridiculous.  So
I say, treat acronyms like words.


Reply via email to