Skip to content

Simplify Data Structures

Ben Stabler edited this page Oct 22, 2018 · 5 revisions

Need

Daysim data structures, such as the tour classes, are overly complex, and are therefore difficult to manage across regions. We need to simplify the data structures so they are easier to manage and adapt as Daysim evolves for new/existing purposes.

Current Example

There are currently 8 class DomainModels for representing a tour in Daysim Actum for example:

ITour, ITourWrapper, IActumTour, IActumTourWrapper - interfaces
Tour, TourWrapper, ActumTour, ActumTourWrapper - actual objects
  • Tour contains just fields and defines what the input file and output file for a tour contains.
  • TourWrapper contains all the additional logic, methods, etc around the basic tour class
  • The Actum classes just adds additional Actum fields and methods

Solution

  • remove all the interfaces - ITour, ITourWrapper, IActumTour, IActumTourWrapper
  • remove the Actum specific classes - ActumTour, ActumTourWrapper
  • from now on, add any new fields and methods to only Tour and TourWrapper since these are the only remaining classes
  • previously the tour class fields were also used for specifying what fields to read and write when doing tour I/O. This will be different in the future, so the tour class can contain stuff that is not required for the specific implementation. Moving forward, what fields are actually in the input file will specify what fields to read in, and any non-null fields will be written out. The domain model classes will therefore contain all fields required for all Daysim implementations, but the input files don't have to.
  • from now on, developers don't remove or override fields, they only add additional fields if needed.
  • LATER: we will add Actum fields and methods back in to Tour and TourWrapper once Actum is funded again.