Use "get," "set", and "is

The JavaBean naming conventions "get," "set," and "is" are methods that read and change private fields, and you must use them even if you're not planning to create a JavaBean at the time. Not only does it make it easy to use your class as a bean at a later time, but it's a standard way to name these types of Java methods and so will be more easily understood by members of your team.



Previous: #5 - Follow a canonical form
 
Next: #7 - Make iterative testing of classes easy


Follow the Sun coding conventions Use "get," "set," and "is"
Standardize! Make iterative testing of classes easy
Follow standard capitalization rules Avoid inheritance
Don't create your own "decorated" private data member names Don't overuse finalization
Follow a canonical form Use nested classes


Java Zone - Get Help - Search Tips

 

Eckel's Ten Java Maxims for Good Design
DevX's Review of Eckel's "Thinking in Java"
"Thinking in Java, Second Edition" DevX product listing
Eckel's Home Page
Java Code Library
Java Pro Magazine
Java Discussion Group

 TALK BACK
Is a set of standard coding rules enforceable in a medium or large organization? Does your team and/or company have a standardized Java coding scheme? Join the discussion and tell our growing Java development community about it.
Click here to Join


Save on Hot Java Specials
SOFTWARE:
dtSearch Web
Add power searching to your web site.
Buy Now!
BOOKS:
PointBase Mobile Edition
Enable local data access for mobile users.
Buy Now!
Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers