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

Drop legacy & internal registries from the public interface #625

Merged
merged 5 commits into from Dec 28, 2020

Conversation

nolar
Copy link
Owner

@nolar nolar commented Dec 28, 2020

Drop all legacy registries and hide all internal sub-registries from the public interface exposed to the users (operator developers).

THIS IS A BREAKING CHANGE. => Major version increase is required.

Background

These registries never were the main value of the framework, but a side-effect of a specific implementation in the past. The implementation changed several times, but the registries had to be maintained. Exposing them was a mistake in the first place. Their maintenance took more and more effort and would take even more unless they are made an internal implementation-specific detail.

The time has come to drop & hide them. Yet another refactoring of registries was needed as a prerequisite for a big refactoring of the reactor's core to be dynamic (#600), and this time, there was no way to ensure backward compatibility for the legacy registries.

Breaking changes

The users should only use OperatorRegistry as an object that is passed to the registry= option of the decorators and the operator() routines. They should never rely on any methods of accessing the content of the registry either for reading or for writing.

By making these fields protected (underscore-named), we declare that despite the fields are accessible, their naming, meaning, and own signatures can change any time without warning or ensuring backwards-compatibility.

Related: #511

They complicate the tests and maintenance of the framework. And they are very old, barely used, and exposed to the users by mistake (registries are not the framework's value).
The users should only use it as an object that is passed to the `registry=` option of the decorators and the `operator()` routines. They should never rely on any methods of accessing the content of the registry either for reading or for writing.

By making these fields protected (underscore-named), we declare that, despite the fields are accessible, their naming, meaning, and own signatures can change any time without warning or ensuring backward compatibility.

As part of this change, also hide those specialised sub-registries classes from the public interface of the framework.

Originally, there was an idea to make a `OperatorRegistryAccessor` or `OperatorRegistryView` wrapper for internal use only. This would solve an issue with accessing the protected fields all over the code. But the severity of the issue is low: it only looks not nice, and might be caught by the linters (questionable) — while the accessor/view class would add complexity.
@nolar nolar added refactoring Code cleanup without new features added breaking Changes that break backwards compatibility of the public interface labels Dec 28, 2020
@nolar nolar changed the title Drop legacy registries Drop legacy & internal registries from the public interface Dec 28, 2020
@nolar nolar merged commit 878a5af into master Dec 28, 2020
@nolar nolar deleted the drop-legacy-registries branch December 28, 2020 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Changes that break backwards compatibility of the public interface refactoring Code cleanup without new features added
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant