motif
motif copied to clipboard
Feature Request: Provide a builder method for "root" motif scopes
This is an extension to #52 with a slightly different and more generic use case.
if you are trying to decompose motif scopes in multiple libraries as in the case of the api/impl pattern it would be helpful to be able to have a Builder method or class generated for motif "root" scopes.
library-api
interface ScopeDependencies {
Input input();
}
interface ScopeComponent {
Output output();
}
@motif.Builder
interface ScopeBuilder {
ScopeComponent build(ScopeDependencies dependencies);
}
library-impl
@motif.Scope
@WithBuilder(ScopeBuilder.class)
interface Scope extends ScopeComponent {
}
@Leland-Takamine the dependencies part was resolved with the introduction of Creatable do we still want to consider to introduce an api to return superclasses of the scope instead of the scope itself ? (basically a build in @AutoService capability within the framework)or are we ok with leaving that to the developer?