P. 1
JavaBeans API Specification 1.01

JavaBeans API Specification 1.01

|Views: 40|Likes:
Published by mevanlc
This is the Sun Microsystems JavaBeans API specification, version 1.01. It describes the core specification for the JavaBeans component architecture.
This is the Sun Microsystems JavaBeans API specification, version 1.01. It describes the core specification for the JavaBeans component architecture.

More info:

Published by: mevanlc on Oct 29, 2010
Copyright:Traditional Copyright: All rights reserved

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/05/2011

pdf

text

original

Let's start with an initial definition and then refine it:

“AJavaBeanisareusablesoftwarecomponentthatcanbemanipulatedvisually
in a builder tool.”

This covers a wide range of different possibilities.

Thebuildertoolsmayincludewebpagebuilders,visualapplicationbuilders,GUIlayoutbuild-
ers,orevenserverapplicationbuilders.Sometimesthe“buildertool”maysimplybeadocu-
ment editor that is including some beans as part of a compound document.

SomeJavaBeansmaybesimpleGUIelementssuchasbuttonsandsliders.OtherJavaBeans
maybesophisticatedvisualsoftwarecomponentssuchasdatabaseviewers,ordatafeeds.
SomeJavaBeansmayhavenoGUIappearanceoftheirown,butmaystillbecomposedtogeth-
er visually using an application builder.

Somebuildertoolsmayoperateentirelyvisually,allowingthedirectpluggingtogetherofJava
Beans.OtherbuildersmayenableuserstoconvenientlywriteJavaclassesthatinteractwithand
controlasetofbeans.Otherbuildersmayprovideasimplescriptinglanguagetoalloweasy
high-level scripting of a set of beans.

IndividualJavaBeanswillvaryinthefunctionalitytheysupport,butthetypicalunifyingfea-
tures that distinguish a Java Bean are:

•Support for “introspection” so that a builder tool can analyze how a bean works

•Supportfor“customization”sothatwhenusinganapplicationbuilderausercan
customize the appearance and behaviour of a bean.

•Supportfor“events”asasimplecommunicationmetaphorthancanbeusedtoconnect

up beans.

•Support for “properties”, both for customization and for programmatic use.

•Supportforpersistence,sothatabeancanbecustomizedinanapplicationbuilderand
then have its customized state saved away and reloaded later.

Abeanisnotrequiredtoinheritfromanyparticularbaseclassorinterface.Visiblebeansmust
inheritfromjava.awt.Componentsothattheycanbeaddedtovisualcontainers,butinvisible
beans (see 2.7 below) aren’t required to do this.

Notethatwhilebeansareprimarilytargetedatbuildertoolstheyarealsoentirelyusablebyhu-
manprogrammers.AllthekeyAPIssuchasevents,properties,andpersistence,havebeende-
signed to work well both for human programmers and for builder tools.

Manybeanswillhaveastrongvisualaspect,inboththeapplicationbuilderandinthefinalcon-
structed application, but while this is common it is not required.

JavaBeans

Fundamentals

Sun Microsystems

10

8/8/97

2.1.1

Beans v. Class Libraries

Notallusefulsoftwaremodulesshouldnecessarilyturnintobeans.Beansareappropriatefor
softwarecomponentsthatcanbevisuallymanipulatedandcustomizedtoachievesomeeffect.
Classlibrariesareanappropriatewayofprovidingfunctionalitythatisusefultoprogrammers,
but which doesn't benefit from visual manipulation.

SoforexampleitmakessensetoprovidetheJDBCdatabaseaccessAPIasaclasslibraryrather
thanasabean,becauseJDBCisessentiallyaprogrammaticAPIandnotsomethingthatcanbe
directlypresentedforvisualmanipulation.Howeveritdoesmakesensetowritedatabaseac-
cessbeansontopofJDBC.Soforexampleyoumightwritea“select”beanthatatcustomiza-
tiontimehelpedausertocomposeaselectstatement,andthenwhentheapplicationisrunuses
JDBC to run the select statement and display the results.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->