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

Provide NamedInterfaces and shared modules lookup strategies #851

Open
murdos opened this issue Sep 29, 2024 · 1 comment
Open

Provide NamedInterfaces and shared modules lookup strategies #851

murdos opened this issue Sep 29, 2024 · 1 comment
Assignees
Labels
in: core Core module meta model meta: waiting for feedback Waiting for feedback of the original reporter

Comments

@murdos
Copy link

murdos commented Sep 29, 2024

While trying to setup spring-modulith on an existing project that has already multiple modules, each one designed to used hexagonal architecture, I realized that spring-modulith does not support hexagonal architecture.

I think that by allowing spring-modulith modules detection to be more customizable, by providing additional extension points like strategies for identifying NamedInterfaces from a module base package, it should be possible to support this architecture, and others.

I made a rough experiment here:

Note that it would require to open API to create NamedInterfaces and NamedInterface.

Additionally, it would probably be useful to provide a lookup strategy to identify shared modules, when it's possible to automatically detect them, and avoid manual declarations through @Modulithic attribute.

@odrotbohm
Copy link
Member

odrotbohm commented Oct 1, 2024

Thanks for opening up this ticket. I think before jumping to conclusions (Spring Modulith not supporting hexagonal architecture) and suggesting changes to the implementation, it would be helpful if you laid out what you're trying to achieve, what means you're using to implement those goals. We can then elaborate whether those are the appropriate ones or whether there are alternative approaches. Plus, you bring up three different things here: providing NamedInterfaces (already an internal abstraction), shared modules lookup strategies and support for Hexagonal Architecture (already support, although not a first-class citizen). I think we need to discuss and justify each of them individually.

Fundamentally, any of the separation of concerns architectures (Hexagonal, Onion) are an implementation detail to a module. With jMolecules, a library exists that allows declaring the architectural stereotypes language in the codebase. In combination with Spring Modulith's named interface concept, we know about several applications using Hexagonal Architecture and Spring Modulith in combination.

Is there any chance you provide a minimal reproducer to demonstrate what you're looking for? I cannot really tell that from the sample project you linked to. Ideally, without any references to third-party frameworks that might already come with precompile opinions? The last time I interacted with JHipster, the team was pretty opposed to a domain-oriented code arrangement approach, insisted on a rather technical first-level decomposition strategy, which is at odds with decomposition for encapsulation.

@odrotbohm odrotbohm self-assigned this Oct 1, 2024
@odrotbohm odrotbohm added in: core Core module meta model meta: waiting for feedback Waiting for feedback of the original reporter labels Oct 1, 2024
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 meta: waiting for feedback Waiting for feedback of the original reporter
Projects
None yet
Development

No branches or pull requests

2 participants