The Java Bean naming standard does not have any support for methods except the following: - getXxx and setXxx, where xxx is your property - addXxxListener and removeXxxListener, for adding and removing XxxListener instances
You are correct Rob I was confused when I referred the Study Guide for SCJP of Kathy and Bert it mentions naming conventions only for set and get methods for Java Beans.Then what came into my mind was what is the naming standard for methods that are not setting or returning values.According to what I get Java Beans does not have methods other than for setting or returning values.Am I correct?
Well there's the adding and removing of event listeners I mentioned, but for the rest no.
Still, addBook(Book book), removeBook(Book book), addBooks(Book books), addBooks(Collection<Book> books), removeBooks(Book books) and removeBooks(Collection<Book> books) are perfect names - as long as they do what the say they do
I'd disagree slightly with Rob and Campbell. If you are adding all of the elements of one collection to the contents of another collection then I would follow the naming used in the Collection interface. i.e. use addAllBooks(List<Book> books) instead of addBooks(List<Book> books).
[ October 17, 2008: Message edited by: Paul Beckett ]
posted 11 years ago
Is there a document that I can refer about Java Bean naming standard