question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Find a better name for @NamedInterface

See original GitHub issue

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.

- com.acme
- com.acme.module
  + PublicType <- implicit API, because public and in the module package
  o PackageProtectedType

If the module contains sub-packages, all types in the sub-packages are considered internal.

- com.acme
- com.acme.module
  + PublicType <- implicit API, because public and in the module package
  o PackageProtectedType
- com.acme.module.internal
  + PublicType <- unaccessible by other modules

@NamedInterface exists to annotate packages (and soon types, see #74) to define a named set of types to act as a dependency target.

- com.acme
- com.acme.module.api
  - package-info.java // annotated with e.g. @NamedInterface("API"), makes all public types API
  + PublicType 
  o PackageProtectedType
- com.acme.module.internal
  + PublicType <- unaccessible by other modules
- com.acme.module.spi
  - package-info.java // annotated with e.g. @NamedInterface("SPI"), makes all public types SPI
  + PublicType 
  o PackageProtectedType

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?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
simonbrowndotjecommented, Sep 12, 2019

What about something like “published” or “exported” … the Java module system uses similar concepts for distinguishing between public and published types.

0reactions
odediacommented, Sep 20, 2019

The annotation sounds more like a command to me. So perhaps something like @AllowAccess, @AllowExternalAccess or @ExposeInterface?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find a better name for @NamedInterface · Issue #75 - GitHub
@NamedInterface exists to annotate packages (and soon types, see #74) to define a named set of types to act as a dependency target....
Read more >
Variable named interface - java - Stack Overflow
I was wondering if there is a "standard" name for such a variable, like for example the clazz for a Class variable.
Read more >
Identifying Network Interface Names for Linux and Solaris OS ...
When configuring an operating system for a networked server, it is necessary to provide the logical names (assigned by the OS) and the...
Read more >
The name game: Naming network interfaces in Linux - Red Hat
It only prints the new name and return. This is a great way to make sure that you have the command correct before...
Read more >
MATLAB getInterface - MathWorks
interface = getInterface( dictionary , name , Name,Value ) gets the object for a named interface in the interface dictionary with additional options....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found