posted 20 years ago
I think there's one more requirement in the definition of Java Bean, and that's a "default constructor" - one with no arguments.
The idea with all the get and set methods is that you can "inspect" a bean through the reflection APIs and discover all those methods. Tools like IDEs could accept a new bean they've never heard of before, figure out all the get and set methods and build a properties sheet and integrate the bean quite nicely. I don't know how much this technology caught on, but I think not near as much as the inventors hoped.
If you haven't heard of reflection, trust me it's cool, it's a bit advanced, and one day you'll have a ball with it.
You'll also hear about Enterprise Java Beans. Something else altogether, not related, very different (am I making the point) not the same thing.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi