-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Labels
Milestone
Description
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 theBaseGeneratorclass).
Fields in the Context class are public and can be set/get directly without using a method.- 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.
Reactions are currently unavailable