3 ms·
What's the use case for java.beans in a non-GUI application? Why do you say almost every Java application depends on it?
by lmm 9y ago
What's the use case for java.beans in a non-GUI application? Why do you say almost every Java application depends on it?
- needusername 9y ago> What's the use case for java.beans in a non-GUI application? Mostly simplified calling of getters and setters, i.e. emulation of object properties. > Why do you say almost every Java application depends on it? - JAXB (XML binding) and Activation depend on it, so if you have direct or indirect dependency on JAXB or Activation you need java.beans. - Spring depends on java.beans
- vbezhenar 9y agoIt's hard to imagine an application without getters and setters. Now if you want to read/write those beans in a generic way, you need to use reflection. And correct approach is to use java.beans classes instead of rolling your own low-level solution.