Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword or section
Like this
33Activity
P. 1
Notes on JavaBeans

Notes on JavaBeans

Ratings: (0)|Views: 1,849 |Likes:
Published by nagraj_ciet
lecture notes on java beans
lecture notes on java beans

More info:

Published by: nagraj_ciet on Nov 30, 2009
Copyright:Attribution Non-commercial

Availability:

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

07/10/2013

pdf

text

original

 
The JavaBeans™ architecture is based on a component model which enables developersto create software units called
components
. Components are self-contained, reusablesoftware units that can be visually assembled into composite components, applets,applications, and servlets using visual application builder tools. JavaBean components areknown as
beans
.A set of APIs describes a component model for a particular language. The JavaBeans API
describes the core detailed elaboration for the JavaBeans componentarchitecture.Beans are dynamic in that they can be changed or customized. Through the design modeof a builder tool you can use the Properties window of the bean to customize the bean andthen save (persist) your beans using visual manipulation. You can select a bean from thetoolbox, drop it into a form, modify its appearance and behavior, define its interactionwith other beans, and combine it and other beans into an applet, application, or a new bean.The following list briefly describes key bean concepts.
Builder tools discover a bean's features (that is, its properties, methods, andevents) by a process known as
introspection
. Beans support introspection in twoways:
o
By adhering to specific rules, known as
design patterns
, when naming bean features. The
 class examines beans for these design patterns to discover bean features. The
Introspector
class relies on the
core reflection
API. The trailThe Reflection APIis an excellent place tolearn about reflection.
o
By explicitly providing property, method, and event information with arelated
bean information
class. A bean information class implements the
BeanInfo
interface. A
BeanInfo
class explicitly lists those bean featuresthat are to be exposed to application builder tools.
 Properties
are the appearance and behavior characteristics of a bean that can bechanged at design time. Builder tools introspect on a bean to discover its properties and expose those properties for manipulation.
Beans expose properties so they can be customized at design time.
Customization
is supported in two ways: by using property editors, or by using moresophisticated bean customizers.
Beans use
events
to communicate with other beans. A bean that is to receiveevents (a listener bean) registers with the bean that fires the event (a source bean).Builder tools can examine a bean and determine which events that bean can fire(send) and which it can handle (receive).
 Persistence
enables beans to save and restore their state. After changing a bean's properties, you can save the state of the bean and restore that bean at a later time
 
with the property changes intact. The JavaBeans architecture uses Java ObjectSerialization to support persistence.
A bean's
methods
are no different from Java methods, and can be called fromother beans or a scripting environment. By default all public methods areexported.Beans vary in functionality and purpose. You have probably met some of the following beans in your programming practice:
GUI (graphical user interface)
 Non-visual beans, such as a spelling checker 
Animation applet
Spreadsheet application
Lesson: Using the NetBeans GUI Builder
his lesson explains how to use the NetBeans IDE GUI Builder to work with beans. In preparation for working with the GUI Builder, you should be first familiar with the key NetBeans concepts which are explained in the NetBeans IDE Java Quick Start Tutorial.This lesson guides you through the process of creating a bean pattern in the NetBeans projects, introduces the user interface of the GUI Builder, and explains how to add your  bean object to the palette.
Creating a New Project
In the NetBeans IDE, you always work in a project where you store sources and files. Tocreate a new project, perform the following steps:1.Select New Project from the File menu. You can also click the New Project button in the IDE toolbar.2.In the Categories pane, select the General node. In the Projects pane, choose theJava Application type. Click the Next button.3.Enter MyBean in the Project Name field and specify the project location. Do notcreate a
Main
class here, because later you will create a new
Java
class in this project.4.Click the Finish button.This figure represents the expanded MyBean node in the Projects list.

Activity (33)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Negasi Abebe liked this
Savan Kharadi liked this
Vijaya Bhavana liked this
Amadou Bagayoko liked this
Vansh Aggarwal liked this
bhagwatsachin liked this
seravanakumar liked this

You're Reading a Free Preview

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