Skip to content

Add default RepositoryConfigurationExtension.getModuleIdentifier() method #2644

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

Closed
mp911de opened this issue Jun 14, 2022 · 5 comments
Closed
Assignees
Labels
type: enhancement A general enhancement

Comments

@mp911de
Copy link
Member

mp911de commented Jun 14, 2022

The module prefix is being used in various places, however the implementation is only available on the abstract RepositoryConfigurationExtensionSupport class and not on the RepositoryConfigurationExtension interface. We should provide a default method for easier consumption. This change requires an update of all RepositoryConfigurationExtensionSupport implementations that define a protected getModulePrefix method.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 14, 2022
mp911de added a commit that referenced this issue Jun 14, 2022
…ion`.

This is a breaking change as many modules implement a protected method. We're going to change this later with #2644.

Original pull request: #2635.
See #2634.
@jxblum
Copy link
Contributor

jxblum commented Jun 14, 2022

Not opposed to this change, but what was just wondering what was the main motivation driving this change (now)?

@mp911de
Copy link
Member Author

mp911de commented Jun 14, 2022

This is to split out the change so we can merge the the ManagedTypes change without the need to touch all modules.

@jxblum
Copy link
Contributor

jxblum commented Jun 14, 2022

Ah, right. Thx, @mp911de.

@odrotbohm odrotbohm changed the title Add default RepositoryConfigurationExtension.getModulePrefix() method Add default RepositoryConfigurationExtension.getModuleIdentifier() method Jun 20, 2022
@odrotbohm
Copy link
Member

In the triage call today we came to the following, slightly different conclusion:

  • The method is supposed to be named getModuleIdentifier() as – while there are currently methods called getModulePrefix() in abstract base types of the interface – the value returned is not the module prefix, it's the module's name but used as a prefix, primarily to build the name for the named queries properties file.
  • The default implementation will lower-case the getModuleName() and defensively replace spaces with dashes, although no official module actually uses spaces in their module names.

The introduced getModuleIdentifier() should then be used as alternative to the getModulePrefix() methods in the individual store's configuration extension base classes.

@odrotbohm odrotbohm self-assigned this Jun 20, 2022
@odrotbohm odrotbohm removed the status: waiting-for-triage An issue we've not yet triaged label Jun 20, 2022
@odrotbohm odrotbohm added this to the 3.0 M5 (2022.0.0) milestone Jun 20, 2022
odrotbohm added a commit that referenced this issue Jun 20, 2022
@odrotbohm
Copy link
Member

This is in place now. As indicated in 75387bb, modules are encouraged to move away from implementing getModulePrefix() (they still need to keep the implementation around, still), rather implement getModuleName() to return a human-readable name of the module and potentially additionally getModuleIdentifier() in case the translation implemented in RepositoryConfigurationExtension doesn't match the current arrangement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants