motif icon indicating copy to clipboard operation
motif copied to clipboard

Feature Request: Provide a builder method for "root" motif scopes

Open andreasnomikos opened this issue 6 years ago • 1 comments

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 {
  
}

andreasnomikos avatar Apr 19 '19 12:04 andreasnomikos

@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?

andreasnomikos avatar Jan 24 '20 16:01 andreasnomikos