FlexibilityThe mapping JiBX applies in converting between your classes
and XML is specified by a binding definition. The binding definition
lets you control such basic details as whether a particular simple
property of a class (such as a primitive value, or a JiBX goes beyond this simple form of mapping, though. Other data binding frameworks generally force each XML element with complex content (attributes, or child elements) to be mapped to and from a distinct object, so that your object structure directly matches the layout of your XML documents. With JiBX you can be more flexible - child elements can be defined using a subset of the properties of an object, and properties of a referenced object can be included directly as simple elements or attributes of the current element. This lets you make many types of changes to either your class structure or your XML document structure without needing to change the other to match. There are limits to the flexibility provided by JiBX, but by giving you the ability to adapt to changes it helps insulate both sides of the Java-XML binding from changes in the other side. This is especially useful for new projects where XML document interchange formats may need to be defined early on, while the application code is still undergoing development. The binding definition allows you to refactor your code without effecting other components using the same XML documents. For more details, see the Structure mapping discussion in the Binding Tutorial. |