The computer software industry has developed several programming
models and frameworks that enable developers to encapsulate business object
(BO) information. In general, a BO framework should provide database independence,
transparently map custom business objects to database tables or to data structures
in enterprise information systems, and bind business objects to user interfaces.
Of late, XML schemas are perhaps the most popular and accepted way to represent
the structure of a business object.
From a tooling perspective, WebSphere® Integration Developer provides
developers with a common BO model for representing different kinds of entities
from different domains. At development time, WebSphere Integration Developer represents
business objects as XML schemas. At runtime, however, those same business
objects are represented in memory by a Java™ instance of an SDO. SDO is a standard
specification that IBM® and BEA Systems have jointly developed and agreed
on. IBM has
extended the SDO specification by including some additional services that
facilitate the manipulation of data within the business objects.
Before we get into the BO framework, let's look at the basic types of data
that get manipulated:
- Instance data is the actual data and data structures, from simple,
basic objects with scalar properties to large, complex hierarchies of objects.
This also includes data definitions such as a description of the basic attribute
types, complex type information, cardinality, and default values.
- Instance metadata is instance-specific data. Incremental information
is added to the base data, such as change tracking (also known as change summary),
context information associated with how the object or data was created, and
message headers and footers.
- Type metadata is usually application-specific information, such
as attribute-level mappings to destination enterprise information system (EIS)
data columns (for example, mapping a BO field name to a SAP table column name).
- Services are basically helper services that get data, set data,
change summary, or provide data definition type access.
The table shows how the basic types of data are implemented in the WebSphere platform.
Table 1. Data abstractions and the corresponding implementationsData Abstraction |
Implementation |
Instance data |
Business object (SDO) |
Instance metadata |
Business graph |
Type metadata |
Enterprise metadata, Business object type metadata |
Services |
Business object services |
Working with the IBM business object framework
As
we mentioned, the WebSphere ESB BO
framework is an extension of the SDO standard. Therefore, business objects
exchanged between WebSphere ESB components
are instances of the commonj.sdo.DataObject class. However,
the WebSphere ESB BO
framework adds several services and functions that simplify and enrich the
basic DataObject functionality.
To facilitate the creation and manipulation
of business objects, the WebSphere BO framework extends SDO specifications
by providing a set of Java services. These services are part of
the package named com.ibm.websphere.bo:
- BOFactory: The key service that provides various ways to create
instances of business objects.
- BOXMLSerializer: Provides ways to "inflate" a business object from
a stream or to write the content of a business object, in XML format, to a
stream.
- BOCopy: Provides methods that make copies of business objects ("deep"
and "shallow" semantics).
- BODataObject: Gives you access to the data object aspects of a
business object, such as the change summary, the business graph, and the event
summary.
- BOXMLDocument: The front end to the service that lets you manipulate
the business object as an XML document.
- BOChangeSummary and BOEventSummary: Simplifies access to
and manipulation of the change summary and event summary portion of a business
object.
- BOEquality: A service that enables you to determine whether two
business objects contain the same information. It supports both deep and shallow
equality.
- BOType and BOTypeMetaData: These services materialize instances
of commonj.sdo.Type and let you manipulate the associated
metadata. Instances of Type can then be used to create business objects "by type".
- BOInstanceValidator : Validates the data in a business object to
see if it conforms to the XSD.