Applying the composite pattern to build an Odometer