Skip to content

Metadata declared in jMolecules' @Module not considered #846

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
xenoterracide opened this issue Sep 24, 2024 · 1 comment
Closed

Metadata declared in jMolecules' @Module not considered #846

xenoterracide opened this issue Sep 24, 2024 · 1 comment
Assignees
Labels
in: core Core module meta model type: bug Something isn't working type: improvement Minor improvements
Milestone

Comments

@xenoterracide
Copy link

xenoterracide commented Sep 24, 2024

log output

> Logical name: model
> Base package: com.xenoterracide.security.model
> Spring beans:
  o ….controller.RegistrationCtrlr
  o ….user.UserRepository
	at com.xenoterracide.test/com.xenoterracide.test.ApplicationTest.lambda$modulith$0(ApplicationTest.java:26)

my package definition

/**
 * Contains Domain Model classes for security.
 */
@DomainLayer
@BoundedContext(name = "Security")
@Module(name = "Security", id = "security")
package com.xenoterracide.security.model;

import org.jmolecules.architecture.layered.DomainLayer;
import org.jmolecules.ddd.annotation.BoundedContext;
import org.jmolecules.ddd.annotation.Module;

obviously the logical name model isn't going to work. I would think given this output/definition that the logical name would have become security using the id on @Module

If the name/id in @Module isn't supposed to work, is there a way that does? I don't see it in https://docs.spring.io/spring-modulith/reference/fundamentals.html

@odrotbohm odrotbohm changed the title not using names provided by jmolecules @Module Metadata declared in jMolecules' @Module` not considered Sep 26, 2024
@odrotbohm odrotbohm self-assigned this Sep 26, 2024
@odrotbohm odrotbohm added in: core Core module meta model type: bug Something isn't working labels Sep 26, 2024
@odrotbohm odrotbohm added this to the 1.3 RC1 milestone Sep 26, 2024
@odrotbohm odrotbohm changed the title Metadata declared in jMolecules' @Module` not considered Metadata declared in jMolecules' @Module not considered Oct 11, 2024
odrotbohm added a commit that referenced this issue Oct 13, 2024
We now properly translate jMolecules' @module declaration configuring the id attribute explicitly into the identifier used for an application module.
odrotbohm added a commit that referenced this issue Oct 13, 2024
We now properly translate jMolecules' @module declaration configuring the id attribute explicitly into the identifier used for an application module.

Introduce @ApplicationModule(id = …) for Spring Modulith-native identifier customization.
@odrotbohm
Copy link
Member

I've used this ticket to apply an a bit more extensive refactoring to remove a couple of misalignments in semantics. So far, Spring Modulith has always used “name” to refer to an application module's identifier and “display name” as the human-readable variant of that, whereas jMolecules has used “id” and “name”. That's an obvious clash and source of confusion.

In GH-872, I've introduced ApplicationModuleIdentifier to resolve that problem. It also allows us to constrain the tokens to be used as identifiers, as we, for example, use :: as a delimiter between a module name and a named interface in the explicitly declared dependencies in @ApplicationModule(allowedDependencies = …).

On top of that introduction, I've revisited the application module discovery algorithm to properly pick up @Module declarations and the id attribute value of those. I also introduced @ApplicationModule(id = …) as a Spring Modulith-native counterpart of the jMolecules annotation.

@odrotbohm odrotbohm added the type: improvement Minor improvements label Oct 13, 2024
odrotbohm added a commit that referenced this issue Oct 13, 2024
We now properly translate jMolecules' @module declaration configuring the id attribute explicitly into the identifier used for an application module.

Introduce @ApplicationModule(id = …) for Spring Modulith-native identifier customization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Core module meta model type: bug Something isn't working type: improvement Minor improvements
Projects
None yet
Development

No branches or pull requests

2 participants