Refactoring the Code – Printing Selected Beams to Excel - Part 2 (Tekla Open API)
Ok, so we’ve done some significant refactoring.
We’ve considered a lot of things. Some things still to be improved:
-
Naming,
-
Better utilization of the ClosedXML library - because our techniques are quite primitive right now.
-
Testing (this really should be done first, but no matter).
-
Further refining the code according to SOLID design principles.
Here is the code thus far:
Ok, that’s certainly a bit better. Still the namining of the classes is quite poor; and we have the dependency inversion issues that we need to fix. Also is there any need to pass in the beams object direction when at the end of the day, we are converting it to a data structure which the printer can understand? Perhaps we should just pass in the printed data structure? We will address these concerns in Part 3 of our refactoring.