JavaBeans - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

JavaBeans

Description:

What are the security implications for downloading Beans over the Internet? ... 100% Pure Java program ensure compatibility and interoperability between Beans? ... – PowerPoint PPT presentation

Number of Views:154
Avg rating:3.0/5.0
Slides: 19
Provided by: scie196
Category:
Tags: javabeans | beans

less

Transcript and Presenter's Notes

Title: JavaBeans


1
JavaBeans
  • A component architecture

2
What is JavaBeans?
  • NC World (New Computing) Dictionary
  • JavaBeans n. 1. JavaSoft technology. 2. Component
    object model for creating modular applications
    (see object computing)
  • object computing n. 1. A system delivers modular
    programming to the computing mainstream (see
    Java)
  • Java n. 1. A type of object computing system that
    allow you to create a variety of objects
  • The dream of JavaBeans is ..
  • Development of software by building blocks
    through drag drop

3
What is JavaBeans?
  • A Java Bean is a reusable software component that
    can be manipulated visually in a builder tool
  • JavaBeans is a portable, platform-independent
    component model written in the Java programming
    language, developed in collaboration with
    industry leaders.
  • It enables developers to write reusable
    components once and run them anywhere --
    benefiting from the platform-independent power of
    Java technology.
  • The goal of JavaBeans is to create a system
    whereby application developers can take a set of
    beans from a stock library and wire them together
    to make a full application

4
Features of JavaBeans
  • Support for introspection
  • so that a builder tool can analyze how a bean
    works
  • Support for customization
  • so that when using an application builder a user
    can customize the appearance and behavior of a
    bean
  • Support for events
  • as a simple communication metaphor than can be
    used to connect up beans
  • Support for properties
  • both for customization and for programmatic use
  • Support for persistence
  • so that a bean can be customized in an
    application builder and then have its customized
    state saved away and reloaded later

5
Persistent Storage
  • Purpose
  • To use existing data formats and plug into OLE or
    OpenDoc documents (e.g., Excel doc inside a Word
    doc)
  • To be trivial for the common case of a tiny
    Bean (by saving its internal state)
  • Solutions
  • Externalization provides a Bean with full
    control over the resulting data layout.
  • Serialization provides an automatic way of
    storing out and restoring the internal state of a
    collection of Java objects
  • All bean must support either Serialization or
    Externalization

6
Events
  • A mechanism for propagating state change
    notifications between a source object and one or
    more target listener objects

7
Event Adaptors
  • Motivation When additional behavior is required
    during event delivery, an intermediary event
    adaptor class may be defined, and interposed
    between an event source and the real event
    listener.

8
Examples of Event Adaptors
  • Implementing an event queuing mechanism between
    sources and listeners
  • Acting as a filter
  • Demultiplexing multiple event sources onto a
    single event listener
  • Acting as a generic wiring manager between
    sources and listeners

9
Properties
  • Discrete, named attributes of a Java Bean
  • that can affect its appearance or its behavior
  • E.g., label in a GUI button to represent the
    displayed text
  • Properties show up in a number of ways
  • through scripting environments (like object
    fields, e.g., b.Labelfoo)
  • by programming through getter and setter methods
  • in a property sheet for a user to edit when a
    component is customized
  • Typically a beans properties will be persistent

10
Introspection
  • A process of understanding which properties,
    events, and methods a Java Bean supports at
    runtime and in their builder environment
  • Purpose to avoid using any separate
    specification language for defining the behavior
    of a Java Bean.
  • All of its behavior would be specifiable in Java
  • Solution Approaches
  • Reflection a low level mechanism to study the
    methods supported by a target bean
  • Design patterns to deduce from those methods
    what properties, events, and public methods are
    supported

11
Customization
  • Ability to customize the appearance and behavior
    of the various beans they are using when a user
    is composing an application in an application
    builder
  • Two ways
  • An application builder through GUI property sheet
    ( property list property editor)
  • Wizards that guide users through the different
    steps of customizing a bean (for larger or
    complex beans)

12
Automated -- Using an application builder to
construct an Applet
  • 1. Buying the tools
  • 2. Laying out the applet
  • create a new applet and drag-and-drop beans in
    the application builder
  • 3. Customizing the beans
  • Select the button and edit the properties using
    the application builder
  • 4. Connecting up the beans
  • 5. Packaging up the applet
  • 6. Trying it out

13
Manually -- Using beans in a hand-written Applet
  • 1. Loading the tools
  • 2. Laying out the applet
  • - start to type in the code for a new applet
    (init method)
  • 3. Customizing the beans
  • - through calling on the beans property
    accessor methods (e.g., btn.setBackground(java.awt
    .Color.red))
  • 4. Connecting up the beans
  • 5. Packaging up the applet
  • 6. Trying it out

14
FAQ 1
  • Why are component architectures useful?
  • Developers are turning to creating components
    rather than monolithic applications to free
    themselves from slow, expensive application
    development, and to build up a portable, reusable
    code base. This enables developers to quickly
    attack new market opportunities, new joint
    development opportunities, and new ways to sell
    smaller packages of software.

source http//java.sun.com/beans/faq/faq.genera
l.html
15
FAQ 2
  • Is JavaBeans a complete component architecture?
  • JavaBeans is a complete component model. It
    supports the standard component architecture
    features of properties, events, methods, and
    persistence. In addition, JavaBeans provides
    support for introspection (to allow automatic
    analysis of a JavaBeans component) and
    customization (to make it easy to configure a
    JavaBeans component).

source http//java.sun.com/beans/faq/faq.genera
l.html
16
FAQ 3
  • Are there JavaBeans components available that I
    can buy today?
  • Yes. A large number of companies, both large and
    small, have announced their plans to deliver
    JavaBeans-based products including Corel,
    EnterpriseSoft, Gemstone, IBM, JScape, KA
    Software, KL Group, Lotus Development, Novell,
    ProtoView Development, Rogue Wave, and Stingray
    Software among many others. Contact these
    companies for information on product
    availability. Many more companies have adopted
    the JavaBeans component model, take a look at the
    JavaBeans Directory.

source http//java.sun.com/beans/faq/faq.genera
l.html
17
FAQ 4
  • What are the security implications for
    downloading Beans over the Internet?
  • JavaBeans does not add any security features to
    the Java platform. Rather, JavaBeans components
    have full access to the broad range of security
    features that are part of the Java platform.
    JavaBeans components can be used to build a range
    of different kinds of solutions from full-fledged
    Java desktop applications to web-based Applets.

source http//java.sun.com/beans/faq/faq.genera
l.html
18
FAQ 5
  • Does the 100 Pure Java program ensure
    compatibility and interoperability between Beans?
  • The 100 Pure Java Initiative is a program
    designed specifically for developers of Java
    software. Sun will provide testing and marketing
    support specifically for JavaBeans components in
    the first half of 1998.

source http//java.sun.com/beans/faq/faq.genera
l.html
Write a Comment
User Comments (0)
About PowerShow.com