Closed
Description
When using injection, application code would generally not need to interact with the implementation classes. For example, it would receive a Datastore
or Storage
instance directly and never need to interact with any of the factory or ServiceOptions
classes e.g.
class MyApp {
@Resource Datastore dataset;
@Inject Bucket data;
void doSomething() {
// just use dataset and data fields ...
}
}
By separating the API classes that it would use into a separate jar, the user can avoid having a dependency on the implementation itself and on any of the libraries that the implementation happens to use.