pdp10 / astrojournal

LaTeX generator for astronomy reports
https://pdp10.github.io/astrojournal/
GNU General Public License v3.0
0 stars 0 forks source link

New structure for generator package #52

Closed pdp10 closed 8 years ago

pdp10 commented 8 years ago

The generator package is not currently extensible. The data structures AJObservation and AJObservationItem are difficult to maintain if new exporters requiring different or additional data will be included.

pdp10 commented 8 years ago

The last two points are not yet implemented.

pdp10 commented 8 years ago

The focus for this issue was on re-structuring the generator package, so that the extension of importer / exporters was feasible. To do so, a generic data structure (Report.java) was implemented using String[]. This class was not extended. The importers/exporters use an enum type for inferring the column length and the importer initialises Report using this enum type. The exporter also uses the same enum type and therefore the two can communicate. To avoid downcasting, generic method are implemented in Report.java and for each exporter / importer. Although the generator is currently inferring the type of exporters, this can be removed via dependency injection, as the generator only has to pass values to setters. Extensive junit tests have been added.