Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Writing 20 or 30 get/set methods is bad' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Writing 20 or 30 get/set methods is bad
Authored by: buzzlabs on Sep 01, '02 04:52:45AM


One thing I've found in the 10 years I've been programming professionally (been programming for 20 total) is that you should ignore a lot of what people tell you, and you should not look to those with degrees and all sorts of "OO expertise" for the answers.

Especially with Java... But anyway... The Java Beans notion is that you have "getter" and "setter" methods for the attributes which are to be publically-exposed in your class, rather than setting them directly and marking them public or otherwise accessible by other classes in your package. Therefore, it is wise to have "get" and "set" methods.

The project that I wrote Beano for was an ATG Dynamo project. The way to do things there was definitely to have "getter" and "setter" methods for your bean classes, as that's how their lovey (gag) "Relational View" abstraction atop JDBC handled things when it was moving data from SQL query ResultSets into your beans, therefore...


[ Reply to This | # ]