FACTOID # 190: Venezuela has three times as many Subway resturants as France.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

Encyclopedia > Java Beans

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. ...

Contents


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


  Results from FactBites:
 
Java Beans (1570 words)
Java beans are Java objects whose methods and properties can be determined by an application at run time and customize it’s properties using the methods available for that object.An application can determine the methods and properties available in an object using reflection.
An Enterprise Java Bean is written as if it is a single threaded application.In fact,EJB classes can never be mutithreaded.They can not be threads themselves nor can they start any new thread.It is the job of the container to manage instances of EJB classes.
Stateless session beans are shared beans that can be used by many clients.They need not know the conversational state of any transaction.That is the bean does not retain any state information between two successive methods calls invoked on it.This is similar to the familiar http protocol which does not maintain any state information.
  More results at FactBites »

 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your location
Your comments
Please enter the 5-letter protection code


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.