The Artima Developer Community
Articles | Discuss | Print | Email | First Page | Previous | Next
Sponsored Link

Java Rockets Closer to VB-like Ease with JSR 273
by Frank Sommers
May 5, 2005

<<  Page 2 of 2

Advertisement

Design-Time Metadata

A key part of the new beans extension can be understood best with a comparison. Bean authors will be familiar with BeanInfo, a bean companion class that tools discover and associate with a bean class at runtime. Part of the JavaBeans specifications from the beginning, BeanInfo contains static metadata about a bean's class.

The new proposed class, DesignInfo, defines dynamic behavior information about a bean instance. Because DesignInfo is discovered at runtime, or design time, existing beans require no changes to benefit from this new functionality. According to Nuxoll, understanding the difference between design-time configuration and static metadata is key to making Java a friendlier developer environment.

JSR 273 sets out to offer several design-time enhancements to the bean experience. First among them is the ability to define an initial setup for a component when that component is created. For instance, when you drag a component representing a database table to a design canvas, you will be able to define a data model for that table, the columns you wish to populate, and even allow you to proceed to populate that table. The table component's DesignBean will provide hooks for that functionality.

The current JavaBeans specifications define a few static ways to relate beans to one another. JSR 273 offers more dynamic abilities to link beans via the linkBean() method on DesignInfo. That will allow a bean to dynamically interact with mouse events, or respond to drag and drop in a customized way. As a component author, you will even be able to define hot areas on the bean's visual representation for special design-time behavior.

In addition, JSR 273 adds a context item to a bean instance. Such context can include, for instance, a list of common actions a developer would typically perform on that bean. That list could then be displayed by, say, right-clicking on the bean's icon. Nuxoll pointed out such possibilities have been part of VB and .NET for a long time, but were not available for Java components before.

A component author will also be able to specify runtime annotations for a bean. For markup-type components, such as JSF beans, that could mean rendering hints, whereas for components that need to paint on the screen, that often means custom painting. For instance, once you've associated that table with a data source, the design-time representation of that table on the design canvas would be able to display a database icon to indicate the availability of the data source.

In addition to property editors and customizers, all these additions to the JavaBeans API are designed to provide access to live bean proxies that facilitate design-time interaction with beans. While IDEs already define such proxies, says Nuxoll, each IDE vendor provides its own custom mechanism for how such proxies manipulate a bean at design time, and how the IDE provides design-time customization information bean proxies. JSR 273 aims to standardize that interaction. As a result, a component vendor can rely on that standard to provide richer design-time options for her wares.

Will Java technology ever have the kind of component market that drives the VB and .NET universe? "The gap is still huge, but we're working to bridge that gap," says Nuxoll.

Get Involved

While no early draft of this JSR is available at the time of this writing, you can read the design-time API specs for Java Studio Creator. According to Nuxoll, the JSR's spec will likely be based on that source. Nuxoll invites anyone interested in contributing or commenting to contact him, or to join the JSR 273 expert group. Contact information is on the JSR 273 home page on jcp.org.

Talk Back!

Have a question or opinion about the Design-Time API described in this article? Discuss this article in the Articles Forum topic, Java Rockets Closer to VB-like Ease with JSR 273.

Resources

JSR 273, Design-Time API for JavaBeans:
http://jcp.org/en/jsr/detail?id=273

Design-Time API for Java Studio Creator:
http://developers.sun.com/prodtech/javatools/jscreator/reference/apis/index.html

A trial copy of Sun Java Studio Creator is available here:
http://developers.sun.com/prodtech/javatools/jscreator/index.jsp

About the Author

Frank Sommers is a Senior Editor with Artima Developer. He also serves as chief editor of the Web zine ClusterComputing.org, the IEEE Technical Committee on Scalable Computing's newsletter, and is an elected member of the Jini Community's Technical Advisory Committee. Prior to joining Artima, Frank wrote the Jiniology and Web services columns for JavaWorld.

<<  Page 2 of 2

Articles | Discuss | Print | Email | First Page | Previous | Next

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us