Understanding the JavaBeans Java Class

A JavaBean is a Java class that uses setter and getter methods, as a means of introspection of the class attributes. Introspection, like reflection, is the ability to query class attributes by using getXXX(), where XXX is one of the class attributes. A JavaBean can save its state through persistence. Therefore, all of its persistent properties must be serializable. You use a JavaBean to encapsulate data mapping between a form's parameters and a database. It can be used as a data container (DataBean) to transfer information between the Web tier and the EJB tier. A JavaBean can encapsulate data for display purposes (ViewBean) and manage data flow between applets and applications. JavaBeans use events to interact ...

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.