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

BC: make CycloneDX\Core\Spec\Spec internal #344

Closed
jkowalleck opened this issue Aug 26, 2023 · 0 comments · Fixed by #345
Closed

BC: make CycloneDX\Core\Spec\Spec internal #344

jkowalleck opened this issue Aug 26, 2023 · 0 comments · Fixed by #345
Assignees

Comments

@jkowalleck
Copy link
Member

jkowalleck commented Aug 26, 2023

Lately, every time this library got spec-based enhancements, a breaking change was flagged,
Always because of changes to the interface CycloneDX\Core\Spec\Spec .

Changes to CycloneDX\Core\Spec\Spec were needed, because new features were required for the normalizers and spec-feature-set description.
The alternative would be to create a new interface with every feature release, and use interface unions that become longer and longer ...

Technically, a change to CycloneDX\Core\Spec\Spec is a breaking-change for one reasons:
the interface is public and downstream implementations might break when the interface was changed, but the downstream implementation did not receive matching changes.

Downstream-implementations of CycloneDX\Core\Spec\Spec is a RARE CASE,
since all needed implementation should happen in this library already. The CycloneDX\Core\Spec\SpecFactory takes care of it.
Therefore, I would argue, that it would be okay to make the interface CycloneDX\Core\Spec\Spec private/internal.

Since php does not support private classes, since everything is loadable as long as one knows how to access it, the CycloneDX\Core\Spec\Spec should be flagged as @internal in its DocBlock.

To make this possible breaking change even more prominent, lets rename CycloneDX\Core\Spec\Spec to CycloneDX\Core\Spec\_Protocol. With underscore to mark it as internal, in addition to the DocBlock.


result would be, that adding new spec-features would no longer cause a breaking change,


goal:

  • rename CycloneDX\Core\Spec\Spec to CycloneDX\Core\Spec\_SpecProtocol
  • mark CycloneDX\Core\Spec\_SpecProtocol as @internal in DocBlock
@jkowalleck jkowalleck changed the title BC: mark CycloneDX\Core\Spec\Spec internal BC: make CycloneDX\Core\Spec\Spec internal Aug 26, 2023
@jkowalleck jkowalleck self-assigned this Aug 26, 2023
@jkowalleck jkowalleck changed the title BC: make CycloneDX\Core\Spec\Spec internal make CycloneDX\Core\Spec\Spec internal Aug 26, 2023
@jkowalleck jkowalleck changed the title make CycloneDX\Core\Spec\Spec internal BC: make CycloneDX\Core\Spec\Spec internal Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant