3 ms·
The sad thing is all JavaBeans needed was named arguments to the constructor rather than relying on setter names. It's a lot more complicated for every class to
by prodigal_erik 16y ago
The sad thing is all JavaBeans needed was named arguments to the constructor rather than relying on setter names. It's a lot more complicated for every class to let instances be created in a mostly-uninitialized state, relying on a bunch of setter calls in an unspecified order to make the instance actually usable. For one thing, there's no language-supported way to make a setter mandatory, you can't do any better than blowing up at runtime if it wasn't called.
- artsrc 16y agoSpring prefers setters and getters (the constructor support is not as good), and this makes it harder to communicate what is optional configuration with defaults and what is essential.