Skip to content

Region Specific Code

Ben Stabler edited this page Sep 7, 2016 · 4 revisions

Region specific revisions to Daysim are handled by a region specific DLL that is called at runtime and overloads default Daysim methods.

Overview

The basic idea is that each method in Daysim can be overridden by a method defined in a region specific project. The region specific methods are built into a DLL that is loaded at runtime. All the region specific code is stored in a region specific solution under the DaySim.Customizations folder. There are currently region specific DLLs for PSRC, Nashville, and DVRPC.

These region specific projects are included in the master Daysim project since they are part of Daysim proper. They are also built and tested as part of the CI system.

In order to run Daysim with a region specific DLL, you need to add the following property to the config file:

CustomizationDll=PSRC.dll

Adding Region Specific Code

The best way to add region specific code is to copy one of the existing region specific projects, rename it, and revise it as needed.

The key thing to consider when doing so is where to put the region specific method that you will override since it should be useful to other potential future users who might also need to override some of Daysim's logic.

In addition, it is important to make the method as generic as possible and pass in all the likely required objects for future users as well so they simply override the code within the method, as opposed to redefine the interface between Daysim and the region specific solution.

Since Daysim users cannot write to the repository, the workflow for adding region specific overrides is to:

  • Fork the repo
  • Make your changes
  • Test your changes
  • Issue a pull request
  • RSG will merge your changes into the develop branch
  • The CI server will merge the changes into master once the tests pass