JavaBeans: Difference between revisions

Content deleted Content added
Darc (talk | contribs)
m +ja
Line 5:
In spite of many similarities, JavaBeans should not be confused with [[Enterprise JavaBeans]] (EJB), a server-side component technology that is part of [[J2EE]].
 
== NamingJava Bean conventions ==
TheIn [[sourceorder code]]to function ofas a Java Bean isclass, subjectan toobject class must obey certain conventions about method naming, conventionsconstruction, and behavior. These naming conventions make it easierpossible forto beanshave totools that becan reuseduse, replacedreuse, replace, and connected.connect Java Beans.
 
The namingrequired conventions are:
* The class should be [[Serialization#Java|serializable]] (able to persistently save and restore its state)
* Every java bean class should implement java.io.Serializable interface
* It should have nona parametricno-argument constructor
* Its properties should be accessed using get and set methods that follow a standard naming convention
* It should contain theany required event -handling methods
 
Because these requirements are largely expressed as conventions rather than by implementing [[interface (computer science)|interfaces]], some developers view Java Beans as [[Plain Old Java Objects]] that follow certain naming conventions. However, this view is misleading for Java Beans that support event handling, because the method conventions and associated support classes for event handling are fairly intricate, and require the use of specific base classes and interfaces.
 
== See also ==