On Wed, 2018-11-28 at 11:34 +0100, Francesco Mari wrote:
> On Tue, 27 Nov 2018 at 11:45, Tommaso Teofili <
> tommaso.teof...@gmail.com>
> wrote:
> 
> > After having dig into the code for a while I can see following
> options:
> > - have a dedicated OSGi service on the query side that can be then
> > polled in a static way from QueryEngineImpl in order to obtain such
> a
> > reference (see patch from OAK-7904 [1])
> >
> 
> I suggest you don't pursue this option. I find that every service
> introduces additional complexity and hinders the testability of the
> code.
> In oak-segment-tar we pushed all the OSGi bits to a couple of
> services
> (read below) and everything else is just plain Java code that
> explicitly
> declares its dependencies. The API is clearer and the code is much
> more
> testable. You don't want to resort on oak-it-osgi to test your stuff
> ;)

Note that with OSGi R7 you can use constructor injection, and that
makes it really easy to construct your object graphs manually for
testing. So no need to resort to ITs for testing OSGi-aware components.

Not really arguing for one option or the other, but wanted to make sure
everyone is aware of the most recent changes.

Thanks,

Robert

Reply via email to