You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is code, that just instantiates an instance -- even without parameters, using the a default constructor -- that parses from the input. A nightmare for maintenance and code clarity.
Extract all parsing code from constructors.
Note that this is not easy, because also the business logic and the index-mapping leakage is intertwined with the parse code.
Implementation Suggestion
Parse the input into an abstract table structure (without types; e.g. using rapidcsv, which is already used by SOPHIA > 35.0.0).
Parse and interpret the fields into objects. This may be possible with rapidcsv already (with constructors that take strings), but better would be to have static parse functions or even to have a factory or dedicated parser class(es), or so (to keep the parse code out of the objects).
The text was updated successfully, but these errors were encountered:
Currently, there is code, that just instantiates an instance -- even without parameters, using the a default constructor -- that parses from the input. A nightmare for maintenance and code clarity.
Extract all parsing code from constructors.
Note that this is not easy, because also the business logic and the index-mapping leakage is intertwined with the parse code.
Implementation Suggestion
parse
functions or even to have a factory or dedicated parser class(es), or so (to keep the parse code out of the objects).The text was updated successfully, but these errors were encountered: