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

ComparableAttribute and BasicAttribute are preferred #976

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

njr-11
Copy link
Contributor

@njr-11 njr-11 commented Feb 14, 2025

This PR contains updates to make ComparableAttribute and BasicAttribute be preferred for the static metamodel over SortableAttribute and Attribute.

Attribute is now documented as the common supertype that all metamodel attribute interfaces inherit from.
SortableAttribute is discouraged for most usage.
Spec and JavaDoc examples are updated to show ComparableAttribute and BasicAttribute instead.
Elsewhere in spec and JavaDoc, we now list the provided attribute subtypes, along with what they are for, further promoting the use of TextAttribute/ComparableAttribute/BasicAttribute.

As a second commit in this PR, I moved the new internal implementation classes out of the public package where they would be visible as part of the API (it was a mistake that we ever allowed others there, but it was too late in the release cycle to correct it) and put them as package protected under the interface so that they will not be externalized to the user. Instead, the proper way to obtain instances is with the *Attribute.of(name) method. See examples that were also updated. This is cleaner and avoids externalizing implementation, which not only avoids cluttering the API, but also preserves our flexibility in the future to make changes to those implementations that would otherwise be considered a breaking change. I would like to eventually deprecate the .impl package altogether, but I did not do that in this PR.

@njr-11 njr-11 added this to the 1.1 milestone Feb 14, 2025
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