typesafehub / conductr-lib

Other
8 stars 13 forks source link

lagom10-conductr-bundle-lib should be added to bundle, but not the project's classpath #96

Closed dotta closed 8 years ago

dotta commented 8 years ago

The lagom10-conductr-bundle-lib library is needed to run Lagom services in production, but it has no use within the Lagom development environment. The fact that the lagom10-conductr-bundle-lib library is added to a Lagom project classpath can even be problematic, as https://github.com/lagom/lagom/issues/42 demonstrates.

https://github.com/typesafehub/conductr-lib/pull/95 is an OK fix to the problem, but if you'd really want to do it properly, then the lagom10-conductr-bundle-lib should be added to the classpath only when producing a ConductR bundle. By doing so, you will also be able to remove the conditional logic added in https://github.com/typesafehub/conductr-lib/pull/95, because when running in production only the ConductR service locator will be bound to the Lagom ServiceLocator interface.

However, touching the classpath carries a complexity cost that needs to be considered. It also adds magic, since a library will get "dynamically" injected when producing a bundle. These are aspects worth considering, given that the solution implemented in https://github.com/typesafehub/conductr-lib/pull/95 is 1) very simple, 2) easy to understand for everyone, and 3) it gets the job done.

dotta commented 8 years ago

Moved to https://github.com/typesafehub/sbt-lagom-bundle/issues/16