Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ItemKind looks like an open/closed principle violation #18

Open
thatlittlegit opened this issue Nov 23, 2023 · 0 comments
Open

ItemKind looks like an open/closed principle violation #18

thatlittlegit opened this issue Nov 23, 2023 · 0 comments

Comments

@thatlittlegit
Copy link
Collaborator

Right now, each Item has a kind associated with it, via getItemKind. This works, and we use it in e.g. the data access layer, but it seems like a bit of an open/closed problem: adding new types needs to modify this enum, so it isn't really open or closed.

This could maybe be 'fixed' by using instanceof, although that just kicks the problem to the using code. While we probably can't erase the problem entirely, doing that might help at least make it more obvious.

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

No branches or pull requests

1 participant