Skip to content

Refactoring

Howard Jones edited this page Apr 19, 2015 · 1 revision

I'm in the process of some fairly large refactoring work, with several goals:

  1. It will make it easier to collaborate with folks on github if we aren't all working in the same gigantic function or class.
  2. It will make testing easier. One of the big pushes since the last release has been automated testing. This makes it easier to verify that these big changes haven't killed anything. Everything is moving to smaller, testable classes and methods.
  3. It's just good practice. Weathermap's classes for 0.97 were really large, more like modules than classes.

I'm using Code Climate as a 'judge' for the code quality, but more specific goals are:

  1. Concentrate all the references to GD in one place. The general drawing code shouldn't need to know about any image*() functions. It should be dealing with WMPoint, WMColour and WMRectangle objects.
  2. Reduce the interdependence between classes - there are several places where objects just reach into each other's internals (Editor, ProcessString in particular). This may mean adding a lot of accessors.
  3. Reduce the number of properties in each MapItem object - there are a LOT of properties! Lots of them are pairs of inXYZ and outXYZ that should be arrays, or individual colours that should be a colourtable. I'd like to get to multichannel data some day, and anything with in/out versions will need to be an array by then.

Clone this wiki locally