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
In our trainee_attributes class, we have a long list of attributes and metadata for them split across multiple constants, and repeated in several places throughout the file.
What if we move this information out into a YAML file or something and organise it more like this:
That would mean we can keep the attributes class more focused on the validation logic, assigning attributes and that sort of thing, rather than housing all this data. It also means we can add new attributes, and change the metadata just by updating the yaml file.
If we like the pattern, we could also apply it to the other attribute classes.
The text was updated successfully, but these errors were encountered:
adamjcolvin
added
the
refactor
Code changes that don't affect any functionality, but make changing the code easier in the future.
label
Jun 11, 2024
In our trainee_attributes class, we have a long list of attributes and metadata for them split across multiple constants, and repeated in several places throughout the file.
What if we move this information out into a YAML file or something and organise it more like this:
We could then still use the constants we have in the attributes class, but make them much more concise:
That would mean we can keep the attributes class more focused on the validation logic, assigning attributes and that sort of thing, rather than housing all this data. It also means we can add new attributes, and change the metadata just by updating the yaml file.
If we like the pattern, we could also apply it to the other attribute classes.
The text was updated successfully, but these errors were encountered: