An application, say an OSLC server, could need multiple ldp-services on different routes, each one configured with a different storage.js concrete implementation. This needs to be configured in the app using ldp-service, not in ldp-service itself.
ldp-app (oslc-server, or any other app that uses ldp-service) should require the storage service(s) it needs, add it to env.storageService and let ldp-service get the database from here.
ldp-service now has index.js which exports storageService and ldpService.
ldp-service-jena now depends on ldp-service and its storage.js requires('ldp-service').storageService and then replaces the abstract methods with concrete methods.
Finally, ldp-app requires ldpService and instantiates the desired storage service.
var ldpService = require('ldp-service').ldpService;
env.storageService = require('ldp-service-jena');
app.use(ldpService(env))
The app can then set the env properties to different values and instantiate another ldpService on a different route.
An application, say an OSLC server, could need multiple ldp-services on different routes, each one configured with a different storage.js concrete implementation. This needs to be configured in the app using ldp-service, not in ldp-service itself.
ldp-app (oslc-server, or any other app that uses ldp-service) should require the storage service(s) it needs, add it to env.storageService and let ldp-service get the database from here.
ldp-service now has index.js which exports storageService and ldpService.
ldp-service-jena now depends on ldp-service and its storage.js requires('ldp-service').storageService and then replaces the abstract methods with concrete methods.
Finally, ldp-app requires ldpService and instantiates the desired storage service.
The app can then set the env properties to different values and instantiate another ldpService on a different route.