Skip to content

πŸ”’ Mark classes sealed that can be sealed #40

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

Merged
merged 5 commits into from
Apr 26, 2022
Merged

πŸ”’ Mark classes sealed that can be sealed #40

merged 5 commits into from
Apr 26, 2022

Conversation

tomrijnbeek
Copy link
Member

✨ What's this?

This PR marks all the classes that were never designed to be inherited from as sealed. It also does some minor clean-up around structs as well.

πŸ”— Relationships

Closes #31

πŸ” Why do we want this?

Either design for inheritance, or prohibit it. These classes were not designed to become base classes. If we truly care to have consumers implement their own - say - root control, then we should use an interface or specifically designed abstract base class instead.

πŸ— How is it done?

Clicked through all the files. Where a class could be marked as sealed, I did.

πŸ’₯ Breaking changes

Any dependency implementing subclasses of the now sealed classes will break. This is why I intend to increase the minor version next build. We're still in pre-release, so we can't change the major version.

πŸ”¬ Why not another way?

There's only one way to mark classes sealed 😜

πŸ¦‹ Side effects

There are now some eventargs classes not sealed (because they're in turn inherited from), while others are. Perhaps they should all be sealed and use composition, or we should have only abstract classes for inheritance and sealed classes to actually use, or we don't care enough.

πŸ’‘ Review hints

πŸ€·β€β™‚οΈ

@tomrijnbeek tomrijnbeek added the breaking change Issues that would lead to breaking change, or PRs that include breaking changes label Mar 9, 2022
@tomrijnbeek tomrijnbeek requested a review from paulcscharf March 9, 2022 22:09
@paulcscharf paulcscharf merged commit ff1279e into main Apr 26, 2022
@paulcscharf paulcscharf deleted the sealed branch April 26, 2022 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Issues that would lead to breaking change, or PRs that include breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark classes sealed
2 participants