mercredi 6 décembre 2017

How to design an agnostic api with enough modularity for specific implementations

Basically I have generic api for a series of datasources like the following:

api/data/get1
api/data/get2
api/data/get3


The problem is how should this be designed when I want to implement a specific api for a datasource like the following:

 api/data/get1
 api/data/get2
 api/data/get3
 api/data/get4 - api specific to datasource


I am using Spring Boot I have a package structure like the following:

services/
    dataservice/
        impl/
            dataserviceimpl

dataservice is an interface in this scenario

  • dataservieimpl implements get1, get2, get3

    • my question is two-fold:
      • how do I implement a service specific to a datasource
      • what if I have multiple datasource which multiple apis specific to themselves

Thanks for reading

Aucun commentaire:

Enregistrer un commentaire