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
The application is storing all command line arguments to an ARGUMENTS structure. Then almost all field of this structure must be passed to IGenerator.
A Context should be created which contains all the configuration fields for generating code from an input file. The Context shall contains almost the same fields as the ARGUMENTS structure.
This would provide the following benefits:
This Context shall be given to the IGenerator class for generating stuff. This would simplify the duplication of fields.
The ARGUMENTS structure may sync with a Context which is filled in parallel.
Creating "getters" directly in the Context class for each specified usage and generated fields. This would increase cohesion and reduce the coupling with the IGenerator interface. The generator interface would be more focused on generating code for a given context. The ARGUMENTS fields are mostly independent of the generator which is why an independent class would be preferable (instead of having all these fields in the BaseGenerator class).
A Context shall be created for each files identified with the --dir option. The current implementation duplicated the ARGUMENTS structure which may be hard to understand or follow in the code.
It would also simplify unit testing. For example with default values and values that are automatically calculated.
Future changes will have a lower impact on the code. The changes will be targeted to the Context or the IGenerator interface. Not always both.
The text was updated successfully, but these errors were encountered:
The application is storing all command line arguments to an
ARGUMENTS
structure. Then almost all field of this structure must be passed toIGenerator
.A
Context
should be created which contains all the configuration fields for generating code from an input file. The Context shall contains almost the same fields as theARGUMENTS
structure.This would provide the following benefits:
BaseGenerator
class).The text was updated successfully, but these errors were encountered: