I'm learning for a job interview in Java. They told me to learn the concepts of Beans introspection, so I searched the web and read in a couple of sites including the next posts:
- Java introspection and reflection
- Places where JavaBeans are used?
- What is a Java Bean exactly?
- Java doc - Reflection
- Introspection in Java
As far as I understood: Bean is like any other object class in Java, but this class must have the next features:
- All properties private (use getters/setters)
- A public no-argument constructor
- Implements Serializable.
General things:
- Introspection is giving me the possibility to "examine" an object during run-time, and that way I can get the class properties names, methods names constructors etc.
- Introspection uses Reflection to get the Information of a class.
I still have some questions:
- Why do I need this kind of a mechanism, meaning, in which cases should I use introspection instead of using any other thing?
- Is there any difference between bean's introspection and a regular introspection?
- How it's working besides the methods I can use?
I would be happy if someone could give me his own prospective about this subject, or to give me some kind of a link for useful information.