This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It's not totally irrelevant. In order to adhere to the JavaBeans spec, an attribute named myAttribute should have a getter named getMyAttribute and a setter named setMyAttribute. This way Bean boxes can infer the getter and setters.
The exception is boolean fields. A boolean field named myBoolean still has a setter of setMyBoolean, but the getter can be isMyBoolean.
I, myself, tend to include the "is" as part of the field name and use the "get" for the getter. So if a boolean checked to see if something was printed or not would be:
while others would have
Either way workd for JavaBeans, though.
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
On a related note, any one else besides me wish they'd get rid of is() getters for booleans?
I know for some web service tools, IBM's WSAD/RAD/WAS/RAS in particular, where you convert from an EJB to a Web service directly it is mandated that all getters use get() format except booleans which must use is() format. I'm not sure if this quirk is unique to IBM's tool, but I also use other tools which mandate get() usage accross the board, meaning there are places where manual conversions between is() and get() are required for all booleans.
I'm not sure how many other people have encountered this but I find it very frustrating. Just wish they'd stick to get() for everything.