What is a JavaBean exactly?

后端 未结 19 1625
清酒与你
清酒与你 2020-11-22 01:55

I understood, I think, that a \"Bean\" is a Java class with properties and getters/setters. As much as I understand, it is the equivalent of a C struct. Is that true?

<
19条回答
  •  情歌与酒
    2020-11-22 02:17

    Java Beans is a standard, and its basic syntax requirements have been clearly explained by the other answers.

    However, IMO, it is more than a simple syntax standard. The real meaning or intended usage of Java Beans is, together with various tool supports around the standard, to facilitate code reuse and component-based software engineering, i.e. enable developers to build applications by assembling existing components (classes) and without having to write any code (or only have to write a little glue code). Unfortunately this technology is way under-estimated and under-utilized by the industry, which can be told from the answers in this thread.

    If you read Oracle's tutorial on Java Beans, you can get a better understanding in that.

提交回复
热议问题