Dependency Injection for Module Initialization?

LabKey Support Forum (Inactive)
Dependency Injection for Module Initialization? slangley  2008-05-16 13:29
Status: Closed
 
Is there a way that I can use Spring-like dependency injection for the initialization of a custom module I develop for a LabKey server?

Maybe something like putting <beans> <bean> </bean> </beans> tags in the module's schema xml file?

Why would I want to do this?
  My own familiarity, unit-testability, code-reusability, and ease of integrating code I've already written for a Spring environment.
 
 
brendanx responded:  2008-05-16 13:46
Sure. Anything you put in:

/WEB-INF/<module>/<module>Context.xml

e.g.

/WEB-INF/ms1/ms1Context.xml

Will get loaded into a Spring context for your module at start-up (if your module extends SpringModule). We are moving this direction for initializing pipeline configuration.

The MS1 module is a good example.

--Brendan