Evolution of a file format

This sample shows how the evolution of a typical file format might happen. In this example XStream is used as primary serialization framework.

It has been designed to highlight the typical faults developers make. It is not a rant about XStream (or similar tools). Instead it is a rant about choosing the wrong tools for the wrong jobs.

This sample shows which problems might occure and how to solve/avoid them.

Part 1: The Model

The javadocs for the model can be found here. The source code is also available.

Domain Objects:

There are four domain classes:

Domain Objects
Car

This class represents a car. Each car has a price and several extras.

Model

Describes the model of the car.

Extra

Each extra has a description and a price.

Money

The money object is used by the Car and the Extra to represent the price.

Next Part: Serializing using different frameworks: