FACTOID # 139: There are 11 countries where the average woman has more than six children. Ten of them are in Africa.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

Encyclopedia > JavaBeans

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 by James Gosling and colleagues at Sun Microsystems in the early 1990s. ...


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 Java EE. The Enterprise JavaBeans specification is one of the several Java APIs in the Java 2 Platform, Enterprise Edition. ... Java 2 Platform, Enterprise Edition or Java EE (formerly also J2EE) is a programming platform — part of the Java platform — for developing and running distributed multi-tier architecture applications, based largely 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, classes are used to group related variables and functions. ...


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, set and other methods following 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. // General characteristics In an older computer science context serialization means to force one-at-a-time access for the purposes of concurrency control. ... In object-oriented programming, a constructor in a class is a special method (function) that can be used to create objects of the class and never has a return type. ... An interface defines the communication boundary between separate computer components. ... POJO is an acronym for Plain Old Java Object, and is favoured by advocates of the idea that the simpler design, the better. ...


JavaBean Example

 // PersonBean.java public class PersonBean implements java.io.Serializable { private String name; private boolean deceased; // No-arg constructor (takes no arguments). public PersonBean() { } public String getName() { return this.name; } public void setName(String name) { this.name = name; } // Different semantics for a boolean field (is vs. get) public boolean isDeceased() { return this.deceased; } public void setDeceased(boolean deceased) { this.deceased = deceased; } } 
 // TestPersonBean.java public class TestPersonBean { public static void main(String[] args) { PersonBean person = new PersonBean(); person.setName("Bob"); person.setDeceased(true); // Output: "Bob [deceased]" System.out.print(person.getName()); System.out.println(person.isDeceased() ? " [deceased]" : ""); } } 

Adoption

AWT, Swing, and SWT, the major Java GUI toolkits, use JavaBeans conventions for its components, which allows GUI editors like the Eclipse Visual Editor to maintain a hierarchy of components and to provide access to their properties via getters and setters. The Abstract Windowing Toolkit (AWT) is Javas platform_independent windowing, graphics, and user_interface widget toolkit. ... Example Swing widgets Swing is a GUI toolkit for Java. ... SWT is the Standard Widget Toolkit (an open source Graphical User Interface toolkit) for Java (although it is not a Sun Microsystems Java standard). ... GUI can refer to the following: GUI is short for graphical user interface, a term used to describe a type of interface in computing. ... Eclipse is a free software / open source platform-independent software framework for delivering what the project calls rich-client applications, as opposed to thin client browser-based applications. ...


See also

A widget (or control) is an 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:
 
JavaBeans - Wikipedia, the free encyclopedia (362 words)
JavaBeans are software components written in the Java programming language.
In spite of many similarities, JavaBeans should not be confused with Enterprise JavaBeans (EJB), a server-side component technology that is part of Java EE.
AWT, Swing, and SWT, the major Java GUI toolkits, use JavaBeans conventions for its components, which allows GUI editors like the Eclipse Visual Editor to maintain a hierarchy of components and to provide access to their properties via getters and setters.
JavaBeans (249 words)
JavaBeans technology is based on the JavaBeans specification.
Enhancements to the JavaBeans Component API in J2SE 1.4 This document describes changes to the java.beans package that were introduced in version 1.4 of the Java 2 Platform, Standard Edition.
Due to the high level of interest in JavaBeans component architecture, a public newsgroup, comp.lang.java.beans, was created to allow discussions of bean-related topics.
  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.