Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Java Toolbox
"Why Getter and Setter Methods are Evil"
Allen Holub
Accessors and XML
Allen,
Getters and setters, unfortunately, are a tragic reality when designing classes used with XML serializers. The deserializers are bean-style and first invoke a no-arg constructor and then use all the setters. Does this fall into the Border Interface area, as you mentioned with Java Database Connectivity (JDBC)? Doesn't it seem like XML (de)serializers could work without the getters and setters?
This forces astute designers to façade their XML-capable objects. This might be a good topic for another "is evil" article. I'd love to hear your suggestions in this area.
Jed Reynolds
UI-layer abstraction
Allen,
I'm one of those "new OOP designers" mentioned in the article, and I don't understand how to abstract the user interface (UI) layer and at the same time eliminate 99 percent of the getters and setters. Where I can obtain this information?
We are transitioning from legacy two-tier systems written in Delphi to Java. The new system is required to use rich graphical user interface and Web browser views so this subject matter is important to us.
Getters and setters are actually part of the language specification in Delphi.
Cody Skidmore
Database records
Allen,
I'm working on a relatively large project that involves database access and users editing the database records. I'm having trouble applying your concepts to my program. I have objects (classes) that represent signed-on users, each type of record in the tables, and in some cases a representation of several records in related tables combined into one object. Many of them share information with each other, but I still have getters and setters. How do I apply this concept when users need to access and edit the records' various fields? I'm open to any idea that can improve my programming skills.