Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Bean Markup Language (BML) is a historical XML-based language for describing how Java objects are created, configured, and connected. In Part 1, Mark Johnson explains its core elements—including <bean>, <property>, and <add>—through a GUI example. BML describes an object structure; it does not define new Java classes.

What Bean Markup Language does

BML is a declarative wiring language: instead of writing imperative Java statements for every setup operation, a developer describes the objects an application needs and the relationships among them. A BML document can specify new objects, configure their properties or fields, and connect them to other objects.

The IBM BML v2.3 User’s Guide, dated September 22, 1999, describes BML as an XML-based component configuration or wiring language customized for the JavaBean component model. Its scope is broader than only conventional JavaBeans: Mark Johnson’s Part 1 explains that a class need not implement Serializable or provide a no-argument constructor if the document supplies constructor arguments.

How Part 1 builds an object structure

Johnson introduces BML with a ColorFadeBean GUI example. A frame contains a panel and a bean; properties set details such as titles, colors, layout, and fonts. This example illustrates the central idea: the XML describes a graph of Java objects and their configuration rather than defining the Java classes themselves.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Element or attribute Role in the example
<bean> Creates an object of the specified class. An id can register the object so another part of the document can refer to it.
source Refers to an object that has already been registered, allowing the document to reuse an object rather than describe a separate instance.
<property> Sets a bean property. A nested bean can supply an object-valued property instead of a string value.
<string> Represents a string value in the document.
<args> and <cast> Describe constructor arguments and their types. Part 1 uses them to select a constructor such as Font(String, int, int).
<add> Adds an object to a container through an adder registered for the relevant type or operation.
<field> Assigns a public field when property-based configuration is not the appropriate mechanism.

Together, object creation, identity references, nested values, and container additions let BML describe how parts fit together. The id and source mechanism is especially important when multiple parts of an application must share the same object.

Why constructor arguments and converters matter

Traditional JavaBean conventions often assume a no-argument constructor followed by property setters. BML can also describe objects that require constructor arguments: <args> supplies them, and <cast> helps identify their types when choosing an overloaded constructor. In the GUI example, this supports constructing a Font with its name, style, and size.

Property values may need conversion from XML text into Java types. BML’s type-converter registry provides an extension point for conversions beyond built-in cases. Its adder registry similarly allows container operations beyond the built-in cases. These registries make the language adaptable to types and containers without changing the basic XML wiring model.

What happens when a BML document runs

BML had two documented processing approaches, with different deployment trade-offs:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach What it does Trade-off
Player (runtime interpreter) Parses the XML into a DOM, then uses reflection to instantiate and connect objects. Johnson also describes generating event adapters for event relationships. Interprets the document at runtime, which offers flexibility but relies on reflection.
Compiler Generates Java source from the BML description. The resulting source can be compiled into an application or composite bean. Moves work into code generation and compilation, so the deployed application does not need reflection for the BML wiring.

Neither approach turns the XML into new class definitions by itself. The document describes configuration and connections among Java objects; the compiler’s output is Java source that must then be compiled.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Historical context and present-day status

IBM alphaWorks released BML around the XML ’98 Conference in November 1998. Mark Johnson’s introductory Part 1 was published August 20, 1999, and IBM’s BML v2.3 User’s Guide followed on September 22, 1999. These dates place BML in the early period of XML-based Java configuration languages.

The available historical material documents BML’s design and implementations, but does not establish whether it is maintained today, has a supported download, or remains an active commercial program in 2026. It is best understood as a documented historical approach to declarative Java object wiring, not assumed to be a current mainstream framework.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.