XmlObject - Adaptive Object Model

Better Designs Faster

Dynamic Object Models

We can easily make the previous model dynamic, by adding a constructor to the Engine class that takes a parameter indicating the number of cylinders as is shown in this diagram.

Dynamic Object Model Graphic

Figure 3: Dynamic Object Model


Note that the class Engine, now defines a constructor that takes a parameter.  This parameter defines the number of cylinders the engine will have.  Everything else is the same.

Now part of the relationship between engines and cylinders (the number of cylinders) can be specified at runtime, thus the term dynamic.  I know that for most readers this is mind-numbingly simple and I trust that you can see how one might extend this example until it is able to represent the majority of cars that ever existed.

I have seen and used incredibly complex and useful data models constructed by methodically and iteratively following the above steps.

XmlObject Graphic