OBJECT-ORIENTED XML As XML implementations become more sophisticated, they also become larger and more complex. In order to manage the complexity, XML developers need new approaches that can give them a higher-level view of the data they are working with. One approach is to use object- modeling techniques. OVERVIEW There are many aspects to object modeling. The obvious first step is to decide exactly what are the objects you are modeling. Once you know what the objects are, you'll define their particular attributes. Finally, you describe the objects' behavior. WHAT IS AN OBJECT? An object is just a thing. In fact, the NEW SHORTER OXFORD ENGLISH DICTIONARY includes a definition of object as "a material thing that can be seen or perceived." This seems like a good start for defining your XML objects. Each element in your XML document can be thought of as an object. You'll define these as pieces of data, but you must keep in mind that objects need to be able to be seen or perceived. A customer, an order, and a product are all examples of objects. A TRIBUTE TO ATTRIBUTES The same dictionary defines attribute as "an inherent characteristic, quality, or feature of a person or thing; a property." This is the same application of attribute that can be used when modeling objects. An attribute is a piece of information that describes a particular property or feature of an object. Once you have defined your objects, you'll define the specific properties and features of those objects as attributes. For example, a customer may have attributes such as a name and account number. An order has attributes such as order number and total price. A product has attributes such as product description and shipping weight. BEHAVE YOURSELF Object behavior is actually two or more related aspects of your objects. The first aspect is how your object can operate or be operated on. The processes the object can perform might be the internal behavior of the object. There is also the behavior of another object that might affect a particular object. Consider an example where a customer can place an order. The behavior for the customer could be called PlaceOrder. The flip side is that an order has the behavior that a customer can place it. Because both a customer and an order are needed for this behavior, these objects have a defined relationship, or association--the other aspect of your objects. Each object can have both operational behavior and associative behavior. While these behaviors may or may not be part of your actual XML element hierarchy, it will help in defining how applications use and process your XML data. SUMMARY When modeling your information, it may be important to understand the high-level abstraction of objects. By conceiving your data as objects and applying object-modeling techniques, you will have a greater ability to manage growth and complexity. Brian Schaffner is a Senior Consultant for DMR Consulting, a Fujitsu company. He provides architecture, design, and development support for DMR's Telcom360 group. -------------------------------------------