I think this is a good approach and use it all the time. I had no real flaws for this.
An example of my use is something like a library that clears the screen.
I would have a Maven project:
data-source-api
This service has:
package my.datasource.api;
public interface DataSource {
public GetDataResponse getData(GetDataRequest request);
}
Where GetDataRequestand GetDataResponse(and other API classes) are also in the api project.
And also called Maven projects:
data-source-urlfetch-impl // for appengine
data-source-http-client-impl // for Apache HTTP client
data-source-urlconnection-impl // for appengine/vanilla Java
For each of my implementations. For instance:.
package my.datasource.urlfetch;
public class UrlFetchDataSource implements DataSource {
...
}
source
share