2004-04-03 15:33:04
A place for everything and everything in its place
One of the keys to good object-oriented design is figuring out where to put things.
In general I'm suspicious of classes that are just containers for data with some getters and setters. Certainly there are times when they are needed but I generally look for ways to give them more to do. Usually there are some methods that can go into the bean classes.
Martin Fowler's Refactoring book has a smell for Data Classes (pp 86-87). Here is a great quote: "Data classes are like children. They are ok as a starting point, but to participate as a grownup object, they need to take some responsibility."
|