SlideShare a Scribd company logo
2
Most read
9
Most read
10
Most read
Java Beans
Java Bean is platform independent software component written in
            Java Programming language,



   It has been designed to be reuse in different environment.




It is used to perform various functions like:
              Obtaining an inventory value, or
              Forecasting the performance of stock.




We can combine this bean to create Applet, Application, Servlet or other
  composite component.
Beans are dynamic in that they can be changed or customized.



Through the design mode of a builder tool, we can customize the bean
   and then save (persist) customized beans.



These Software Components are self-contained, reusable software units
   that can be visually assembled into composite components, applets,
   applications, and servlets using visual application builder tools.




JavaBean components are known as beans.
Following are the Key bean concepts:

1. Introspection: Java beans support introspection in two ways.
     a) It provides support by adhering to specific rules known as design
        pattern.

     b) It provides support by explicitly providing property, method, and event
        information with a related Bean Information Class.



2. Properties are the Beans appearance & behavior characteristics. This can be
     changed at run time.
3. Beans exposes properties so that, they can be customized at design time.
     This customization can be done in two ways.
        a) Using Property Editors,

        b) Using Bean Customizers.



4. Beans uses event to communicate with other beans.

     A bean that wants to receive events (i.e. Listener Beans) registers with
     Bean that fires the event. (i.e. Source Bean).

     The Builder tool can examine a Bean and determine which events the bean
     can fire (i.e. send) and other bean that can handle (i.e. receive).
5. Persistence enables bean to save & restore there state.

     Once we changes the beans properties, we can save the state of
       the bean and restore that bean at later time.




6. Beans methods are similar to the methods of Java.

     This method can be called from other beans or scripting environments.
Advantages of JavaBeans:
1. Java beans support “Write Once and Run Anywhere” Feature of JAVA.

2. The Properties, Events, & Methods of a bean that are exposed to
        another application can be called.

3. For Bean configuration, an auxiliary software can be provided.
     This s/w can be needed only to set design time parameters, and not needed
     in rum time environment.

4. In Persistent storage, configuration setting of bean can be saved & restored
      later.

5. We can use bean to register the receive events from other objects & generate
    events that are send to other objects.
Persistence:

     Persistence is the ability of an object to store its state,
        for recreation later.



     Beans use Java's object serialization capabilities for persistence.



     Object serialization means converting an object into a data stream and
       writing it to storage.



     Any applet, application, or tool that uses that bean can then "reconstitute"
     it by deserialization.
Introspection:

     Introspection is the process of determining the supported properties,
     methods, and events of a Bean.



     Introspection is the automatic process of analyzing a bean's design
         patterns to reveal the bean's properties, events, and methods.



     This process controls the publishing and discovery of bean operations
        and properties.



     It can be done with the help of the Introspector class, or
         directly through the use of the Reflection API.
Introspection:
Following are the advantages of Introspection:

Portability - Everything is done in the Java platform, so you can write
     components once, reuse them everywhere.

     There are no extra specification files that need to be maintained
     independently from your component code.

     There are no platform-specific issues to contend with. Your component is
     not tied to one component model or one proprietary platform.

Reuse - By following the JavaBeans design conventions, implementing the
        appropriate interfaces, and extending the appropriate classes, you
        provide your component with reuse potential that possibly exceeds
        your expectations.
Customization:

     Customization provides a means for modifying the appearance and
       behavior of a bean within an application builder so
        it meets your specific needs.

     There are several levels of customization available for a bean developer to
     allow other developers to get maximum benefit from a bean’s potential
     functionality

There are two ways to customize a bean:
    By using a property editor: Each bean property has its own property
     editor. The property editor that is associated with a particular property
     type edits that property type.

    By using customizers: Customizers give you complete GUI control over
     bean customization. Customizers are used where property editors are not
     practical or applicable.
Bean Properties:

    The JavaBeans™ specification defines the following types of bean
     properties:

    Simple – A bean property with a single value whose changes are
     independent of changes in any other property.

    Indexed – A bean property that supports a range of values instead of a
     single value.

    Bound – A bean property for which a change to the property results in a
     notification being sent to some other bean.

    Constrained – A bean property for which a change to the property results
     in validation by another bean. The other bean may reject the change if it is
     not appropriate.
Bean Properties:
Bean properties can also be classified as follows:

    Writable – A bean property that can be changed
     Standard

     Expert

     Preferred



     Read Only – A bean property that cannot be changed.

     Hidden – A bean property that can be changed. However, these properties
      are not disclosed with the BeanInfo class
Writing Bean Component:

     To create a Bean, we need to determine what it should do
        and then define the events, properties, and methods for it.

     Actually, most of the method definitions fall out of the definition
        of events and properties for the Bean.

Following are the steps to create simple beans:

     Creating a simple bean
     Compiling the bean
     Generating a Java Archive (JAR) file
     Loading the bean into the GUI Builder of the NetBeans IDE
     Inspecting the bean's properties and events

More Related Content

PPT
Introduction to java beans
PPTX
Windowforms controls c#
PPT
Jdbc ppt
PPT
SQLITE Android
PPTX
Java Beans
PPTX
Java beans
PPT
javascript-basics.ppt
PPTX
Session bean
Introduction to java beans
Windowforms controls c#
Jdbc ppt
SQLITE Android
Java Beans
Java beans
javascript-basics.ppt
Session bean

What's hot (20)

PPS
Java Hibernate Programming with Architecture Diagram and Example
PPTX
Java swing
PDF
Chapter2 Encapsulation (Java)
PPTX
Controls events
PPTX
Cookie & Session In ASP.NET
PPT
Visual Basic menu
PPT
JavaScript Tutorial
PPT
Advanced Web Development
PDF
View & index in SQL
PPT
Scripting languages
PPT
Active x control
PPSX
JDBC: java DataBase connectivity
PDF
Html frames
PPT
Cookies and sessions
PPTX
Asp.NET Validation controls
PDF
Visual Basic IDE Introduction
PPTX
Jdbc ppt
ODP
Introduction of Html/css/js
PPT
Object and class relationships
PPTX
Vb 6.0 controls
Java Hibernate Programming with Architecture Diagram and Example
Java swing
Chapter2 Encapsulation (Java)
Controls events
Cookie & Session In ASP.NET
Visual Basic menu
JavaScript Tutorial
Advanced Web Development
View & index in SQL
Scripting languages
Active x control
JDBC: java DataBase connectivity
Html frames
Cookies and sessions
Asp.NET Validation controls
Visual Basic IDE Introduction
Jdbc ppt
Introduction of Html/css/js
Object and class relationships
Vb 6.0 controls
Ad

Similar to Java beans (20)

PPTX
Unit4wt
PPTX
Unit4wt
PPTX
Unit iv
PDF
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
PPTX
Codename BEAN.pptx
PPT
introduction of Java beans
PPTX
Javabeans
PDF
Javabeans .pdf
PPT
Java beans
PPT
Bean Intro
PPTX
P20CSP105-AdvJavaProg.pptx
PPT
web programmimg- concpt in JAVABEANS.ppt
PPT
Javabean1
PDF
Java beans
PPTX
Rmi, corba and java beans
PPTX
Java Beans Unit 4(Part 1)
PPT
Java beans
PPT
CommercialSystemsBahman.ppt
PDF
javabeans
PPTX
Java Beans Unit 4(part 2)
Unit4wt
Unit4wt
Unit iv
WEB PROGRAMMING UNIT IV NOTES BY BHAVSINGH MALOTH
Codename BEAN.pptx
introduction of Java beans
Javabeans
Javabeans .pdf
Java beans
Bean Intro
P20CSP105-AdvJavaProg.pptx
web programmimg- concpt in JAVABEANS.ppt
Javabean1
Java beans
Rmi, corba and java beans
Java Beans Unit 4(Part 1)
Java beans
CommercialSystemsBahman.ppt
javabeans
Java Beans Unit 4(part 2)
Ad

Recently uploaded (20)

PDF
Pre independence Education in Inndia.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
RMMM.pdf make it easy to upload and study
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Pharma ospi slides which help in ospi learning
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
master seminar digital applications in india
PDF
Computing-Curriculum for Schools in Ghana
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Sports Quiz easy sports quiz sports quiz
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Pre independence Education in Inndia.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
RMMM.pdf make it easy to upload and study
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Pharma ospi slides which help in ospi learning
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Microbial diseases, their pathogenesis and prophylaxis
FourierSeries-QuestionsWithAnswers(Part-A).pdf
102 student loan defaulters named and shamed – Is someone you know on the list?
2.FourierTransform-ShortQuestionswithAnswers.pdf
master seminar digital applications in india
Computing-Curriculum for Schools in Ghana
O5-L3 Freight Transport Ops (International) V1.pdf
Sports Quiz easy sports quiz sports quiz
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf

Java beans

  • 2. Java Bean is platform independent software component written in Java Programming language, It has been designed to be reuse in different environment. It is used to perform various functions like: Obtaining an inventory value, or Forecasting the performance of stock. We can combine this bean to create Applet, Application, Servlet or other composite component.
  • 3. Beans are dynamic in that they can be changed or customized. Through the design mode of a builder tool, we can customize the bean and then save (persist) customized beans. These Software Components are self-contained, reusable software units that can be visually assembled into composite components, applets, applications, and servlets using visual application builder tools. JavaBean components are known as beans.
  • 4. Following are the Key bean concepts: 1. Introspection: Java beans support introspection in two ways. a) It provides support by adhering to specific rules known as design pattern. b) It provides support by explicitly providing property, method, and event information with a related Bean Information Class. 2. Properties are the Beans appearance & behavior characteristics. This can be changed at run time.
  • 5. 3. Beans exposes properties so that, they can be customized at design time. This customization can be done in two ways. a) Using Property Editors, b) Using Bean Customizers. 4. Beans uses event to communicate with other beans. A bean that wants to receive events (i.e. Listener Beans) registers with Bean that fires the event. (i.e. Source Bean). The Builder tool can examine a Bean and determine which events the bean can fire (i.e. send) and other bean that can handle (i.e. receive).
  • 6. 5. Persistence enables bean to save & restore there state. Once we changes the beans properties, we can save the state of the bean and restore that bean at later time. 6. Beans methods are similar to the methods of Java. This method can be called from other beans or scripting environments.
  • 7. Advantages of JavaBeans: 1. Java beans support “Write Once and Run Anywhere” Feature of JAVA. 2. The Properties, Events, & Methods of a bean that are exposed to another application can be called. 3. For Bean configuration, an auxiliary software can be provided. This s/w can be needed only to set design time parameters, and not needed in rum time environment. 4. In Persistent storage, configuration setting of bean can be saved & restored later. 5. We can use bean to register the receive events from other objects & generate events that are send to other objects.
  • 8. Persistence: Persistence is the ability of an object to store its state, for recreation later. Beans use Java's object serialization capabilities for persistence. Object serialization means converting an object into a data stream and writing it to storage. Any applet, application, or tool that uses that bean can then "reconstitute" it by deserialization.
  • 9. Introspection: Introspection is the process of determining the supported properties, methods, and events of a Bean. Introspection is the automatic process of analyzing a bean's design patterns to reveal the bean's properties, events, and methods. This process controls the publishing and discovery of bean operations and properties. It can be done with the help of the Introspector class, or directly through the use of the Reflection API.
  • 10. Introspection: Following are the advantages of Introspection: Portability - Everything is done in the Java platform, so you can write components once, reuse them everywhere. There are no extra specification files that need to be maintained independently from your component code. There are no platform-specific issues to contend with. Your component is not tied to one component model or one proprietary platform. Reuse - By following the JavaBeans design conventions, implementing the appropriate interfaces, and extending the appropriate classes, you provide your component with reuse potential that possibly exceeds your expectations.
  • 11. Customization: Customization provides a means for modifying the appearance and behavior of a bean within an application builder so it meets your specific needs. There are several levels of customization available for a bean developer to allow other developers to get maximum benefit from a bean’s potential functionality There are two ways to customize a bean:  By using a property editor: Each bean property has its own property editor. The property editor that is associated with a particular property type edits that property type.  By using customizers: Customizers give you complete GUI control over bean customization. Customizers are used where property editors are not practical or applicable.
  • 12. Bean Properties:  The JavaBeans™ specification defines the following types of bean properties:  Simple – A bean property with a single value whose changes are independent of changes in any other property.  Indexed – A bean property that supports a range of values instead of a single value.  Bound – A bean property for which a change to the property results in a notification being sent to some other bean.  Constrained – A bean property for which a change to the property results in validation by another bean. The other bean may reject the change if it is not appropriate.
  • 13. Bean Properties: Bean properties can also be classified as follows:  Writable – A bean property that can be changed  Standard  Expert  Preferred  Read Only – A bean property that cannot be changed.  Hidden – A bean property that can be changed. However, these properties are not disclosed with the BeanInfo class
  • 14. Writing Bean Component: To create a Bean, we need to determine what it should do and then define the events, properties, and methods for it. Actually, most of the method definitions fall out of the definition of events and properties for the Bean. Following are the steps to create simple beans: Creating a simple bean Compiling the bean Generating a Java Archive (JAR) file Loading the bean into the GUI Builder of the NetBeans IDE Inspecting the bean's properties and events