I think it makes sense to answer your questions in reverse order ...
Since you have an API, a Snapshot Data Facade can be a good start. The purpose of this template is essentially to provide an interface to which external users can connect.
This type of structure is usually required if you want to expose a number of functions (APIs) without disclosing how you really are about implementing such functions. So, for example, you simply show public BigDecimal calculateTax(BigDecimal amount, double percentage) your users, without showing how you went and implemented your method.
Finally, so I would do it:
com.sample.myproject will be my main project, and in it I will put any basic functions, such as saving objects.
com.sample.myproject.api will com.sample.myproject.api be a project with Interfaces and other things that I want to open.
com.sample.myproject.impl will implement the two projects above, using the main project and some additional logic to determine which API level is available.
source share