|
JavaBeans are software components written in the Java programming language. Software component representations: above the representation used in UML, below the representation commonly used by Microsofts COM objects. ...
Java is an object-oriented programming language developed initially by James Gosling and colleagues at Sun Microsystems. ...
The JavaBeans specification by Sun Microsystems defines them as "reusable software components that can be manipulated visually in a builder tool". Sun Microsystems, Inc. ...
In spite of many similarities, JavaBeans should not be confused with Enterprise JavaBeans (EJB), a server-side component technology that is part of J2EE. The Enterprise JavaBeans specification is one of the several Java APIs in the Java 2 Platform, Enterprise Edition. ...
Java 2 Platform, Enterprise Edition or J2EE is a Standard (albeit with no ISO or ECMA standard) for developing distributed Multi-tier architecture applications, based on modular components running on an application server. ...
JavaBean conventions In order to function as a JavaBean class, an object class must obey certain conventions about method naming, construction, and behavior. These conventions make it possible to have tools that can use, reuse, replace, and connect JavaBeans. In, object-oriented programming, a class consists of a collection of types of encapsulated instance variables and types of methods, possibly with implementation of those types together with a constructor function that can be used to create objects of the class. ...
The required conventions are: - The class should be serializable (able to persistently save and restore its state)
- It should have a no-argument constructor
- Its properties should be accessed using get and set methods that follow a standard naming convention
- It should contain any required event-handling methods
Because these requirements are largely expressed as conventions rather than by implementing 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. In an older computer science context serialization means to force one-at-a-time access for the purposes of concurrency control. ...
An interface is a specification that exists between software components that specifies a selected means of interaction, by means of properties of other software modules, which abstract and encapsulate their data. ...
POJO is an acronym for Plain Old Java Object. ...
JavaBean Example public class PersonBean implements java.io.Serializable { private String name; private int age; public PersonBean() { // Our constructor. Note that it takes no arguments. } public void setName(String n) { this.name = n; } public void setAge(int a) { this.age = a; } public String getName() { return (this.name); } public int getAge() { return (this.age); } } PersonBean person = new PersonBean(); person.setName("Bob"); System.out.println(person.getName()); See also A widget (or control) is a graphical interface component that a computer user interacts with, such as a window or a text box. ...
The Enterprise JavaBeans specification is one of the several Java APIs in the Java 2 Platform, Enterprise Edition. ...
External links |