Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Will,
Thought I'd draw over your design a little to show another potential path.
This one reduces some of the design complexity around inheritance, calls within
the body of the class, removes a few classes, etc. It does add a central registry
list in GildedRose which would be open for modification, but ultimately you have
a list of the files you're requiring in there anyway so it doesn't meaningfully
decrease the open-for-modification-ness of the overall design.
This design also enables the caller of GildedRose to control the list of updaters
and their order — a nice design feature that increase the reusability of the class.
I would tempted to have the caller of GildedRose always have to specify either
their own list or pass the DEFAULT_UPDATERS list explicitly, but that does
definitely increase Connascence between the callers
and the Gilded Rose class so I decided against it in the end.
Let me know what you think.