Componentization

About SOA and CBD

Advantages

Platforms

Our Approach

White Paper and Specifications

CBD Resources

About us

Contact us


Components within the J2SE Platform

The JavaBeansTM technology is the component architecture for the J2SE Development platform. JavaBeans are a simple yet powerful technology for developing component-based software. With JavaBeans, you get the best of both worlds - the power and elegance of Java combined with the simplicity and ease of visual programming. JavaBeans in short provides a broad framework for creating, assembling, and deploying Java component based software.

JavaBeans can be deployed onto most platforms (including Windows, Linux, Solaris, Mac OS X) since you are only required to have a Java Virtual Machine (JVM) deployed onto the host machine. Moreover, a JavaBean encapsulating business functionality can be wrapped as an Enterprise JavaBean and inherit enterprise features by being deployed onto an J2EE Compliant Application server. A business JavaBean can also be Web service enabled and accessed via any other applications or tools which support the Web service standards. Alternatively, if the JavaBean offers visual functionality then its functionality can still be reused either within a Java graphical application such as a JSP or Swing application, or can be used to extend the graphical functionality available from within a Java IDE for example the `palette' within Borland's JBuilder.

JavaBeans Concepts

(Text Source: http://java.sun.com)

The JavaBeansTM API makes it possible to write component software in the Java programming language. Components are self-contained, reusable software units that can be visually composed into composite components, applets, applications, and servlets using visual application builder tools. JavaBean components are known as Beans.

Components expose their features (for example, public methods and events) to builder tools for visual manipulation. A Bean's features are exposed because feature names adhere to specific design patterns. A "JavaBeans-enabled" builder tool can then examine the Bean's patterns, discern its features, and expose those features for visual manipulation. A builder tool maintains Beans in a palette or toolbox. You can select a Bean from the toolbox, drop it into a form, modify it's appearance and behavior, define its interaction with other Beans, and compose it and other Beans into an applet, application, or new Bean. All this can be done without writing a line of code.

The following list briefly describes key Bean concepts, and gives the chapter in the JavaBeans specification where you can read a complete description.

  • Builder tools discover a Bean's features (that is, its properties, methods, and events) by a process known as introspection. Beans support introspection in two ways:
    • By adhering to specific rules, known as design patterns, when naming Bean features. TheIntrospectorclass examines Beans for these design patterns to discover Bean features. The Introspector class relies on the core reflectionAPI. The trail The Reflection API is an excellent place to learn about reflection.
    • By explicitly providing property, method, and event information with a related Bean Information class. A Bean information class implements the BeanInfo interface. A BeanInfo class explicitly lists those Bean features that are to be exposed to application builder tools.
    Chapter 8 of the JavaBeans API Specification discusses introspection, design patterns, and BeanInfo objects.

  • Properties are a Bean's appearance and behavior characteristics that can be changed at design time. Builder tools introspect on a Bean to discover its properties, and expose those properties for manipulation. Chapter 7 of the JavaBeans API Specification discusses properties.

  • Beans expose properties so they can be customized at design time. Customization is supported in two ways: By using property editors, or by using more sophisticated Bean customizers. Chapter 9 of the JavaBeans API Specification discusses Bean customization.

  • Beans use events to communicate with other Beans. A Bean that wants to receive events (a listener Bean) registers its interest 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). Chapter 6 of the JavaBeans API Specification discusses events.

  • Persistence enables Beans to save and restore their state. Once you've changed a Beans properties, you can save the state of the Bean and restore that Bean at a later time, property changes intact. JavaBeans uses Java Object Serialization to support persistence. Chapter 5 of the JavaBeans API Specification discusses persistence.

  • A Bean's methods are no different than Java methods, and can be called from other Beans or a scripting environment. By default all public methods are exported.

Although Beans are designed to be understood by builder tools, all key APIs, including support for events, properties, and persistence, have been designed to be easily read and understood by human programmers as well.



© 1999-2005 WebCab Components. All rights reserved.