Skip to content

Alternative design - #1

Draft
neoeno wants to merge 1 commit into
wimdavies:mainfrom
neoeno:main
Draft

Alternative design#1
neoeno wants to merge 1 commit into
wimdavies:mainfrom
neoeno:main

Conversation

@neoeno

@neoeno neoeno commented Aug 23, 2023

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant