-
Notifications
You must be signed in to change notification settings - Fork 84
Find a better name for @NamedInterface #75
Comments
What about something like "published" or "exported" ... the Java module system uses similar concepts for distinguishing between public and published types. |
But published or exported what? I feel like there should be a noun for this concept as it's named it's something that can be referred to. |
|
|
In our modulith framework, we use |
The annotation sounds more like a command to me. So perhaps something like |
The name I've been using, and is also used in the readme of this project, is Related, I would really like a way to specify that all subpackages should be public as well, but that might be out-of-scope for this task - unless it can be solved by the same annotation with some configuration on the annotation. My use-case for this is:
I could use @odrotbohm, let me know if it is better if I create a separate feature request for this. To scope-creep a bit more, it might also be worth considering if it should be possible to have an internal package of a module be available to other internal packages of the same module. I've not yet have a use for this, but I'm also currently only doing some POC with Moduliths, and could imagine this to be useful for slightly bigger components where more internal structure could be convenient. With the right name, I could see this be part of a |
Context
A Moduliths module exposes types for other modules to be allowed to use. The default set of types consists of all public types in the module's base package.
If the module contains sub-packages, all types in the sub-packages are considered internal.
@NamedInterface
exists to annotate packages (and soon types, see #74) to define a named set of types to act as a dependency target.Problem
The term "named interface" was used to describe that kind of concept, originating from Sonargraph, that exposed that concept in its architecture modeling language. However, using "interface" in a term used inside a Java codebase creates confusion as it's not immediately clear whether you're talking about a Java interface or Moduliths named interface.
Alternatives
UML exposes the same kind of concept as "port" (see this article). Using port might create a few connections towards Hexagonal Architecture and it's ports & adapters concept. While you can implement such an architecture with Moduliths, I wonder whether we should create such strong ties.
Suggestions?
The text was updated successfully, but these errors were encountered: