Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[lyo-dev] DI in Lyo

Hello,

 

I have been working to switch Lyo adaptors from relying heavily on static methods and singletons to using dependency injection. For me the major driver is the ability to test components in isolation and to switch certain implementation strategies:

 

  • I would like to have adaptor managers that use Lyo Store and not
  • I would like to have clients that do remote calls and not
  • I would like to have TRS servers with behaviour defined by some strategy objects rather than constants and overriding methods by subclassing.

 

I have actually started fixing the latter, trying to fix a number of issues in the TrackedResourceSetService abstract class. But I was not sure I could start injecting dependencies there before I got them to work on the adaptor. I have developed example DI code for adaptors in the sample modelling project. If anyone could help me switch from HK2 to CDI, I would be very grateful.

 

If you have any general suggestions regarding DI in Lyo, please join the discussion!

 

--

–Andrew.


Back to the top