Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Describing BeanInfo for a class in XML

IP.com Disclosure Number: IPCOM000011553D
Original Publication Date: 2003-Mar-04
Included in the Prior Art Database: 2003-Mar-04
Document File: 2 page(s) / 47K

Publishing Venue

IBM

Abstract

A method is disclosed that describes an improvement to the way in which metadata is recorded for *JavaBeans. The current JavaBeans specification uses BeanInfo classes and this invention improves upon that by using XML documents. Because an XMLDocument represents it structure in a textual format it is less brittle than a binary *Java class file, and it is easier to read and write for both software packages and users alike

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 52% of the total text.

Page 1 of 2

Describing BeanInfo for a class in XML

When the *JavaBeans component model was first created JavaBeans were seen primarily as a client-side component architecture; the *Java equivalent of **Active-X controls. In the current specification a BeanInfo class is used to describe metadata information for a JavaBean that is used by development tools, such as names of properties and their editor classes. The problem with BeanInfo being a class is that it is brittle and can throw exceptions and have other unpredictable behavior in a runtime environment.

    As well as BeanInfo classes being brittle, the scope of JavaBeans has now grown beyond their initial design intention and they are used in server side runtime programming such as a jsp page, e.g. "<jsp:getProperty name="beanInstanceName" property="propertyName" />". For the JSP page compiler to be able to resolve this into a get method it needs access to the BeanInfo, so the class must be loaded into the J2EE server. Because of how classes are loaded and imports resolved this can drag in lots of other details that are only applicable to the BeanInfo being used in a builder environment, such as property editor or customizer classes. This puts an unnecessary performance and size overhead on the server. Likewise with web services there is a WSDL binding based around wrapping a JavaBean, and to make the WSDL more meaningful the formal method argument names are used, e.g. public void setAmount(double theBalance, Date today) would want to publish itself as a WSDL service with "theBalance" and "today" in its signature, rather than "arg1" and "arg2". To do this when a JavaBean that will be used as a web service is deployed, a BeanInfo class must be created for it to describe a method descriptor that includes the method argument names, and this has the same problems with deployment into the server that the jsp:getProperty and jsp:setProperty tag runs into.

    The existing JavaBeans specification that describes how metadata is described in BeanInfo classes is available for download from http://java.sun.com/products/javabeans/docs/spec.html

    A method is described below for describing how metadata for a JavaBean could be described in XML rather than as a BeanInfo class. The advantage of XML is that it is a formatted document that is easier to read and write than Java class files. Software tools that have to create metadata for JavaBeans currently have to generate and compile a Java source file, and it may need to create their own internal document structure of the BeanInfo to be used by the editor. By using XML instead the software tool could take advantage of existing XML technology for parsing, creating and editing the file. If a...