PDA

View Full Version : Best approach for serviced components?


Alistair
04-27-2005, 05:40 AM
Can anyone recommend the best approach for using Spring's dependency injection for ServicedComponents?

My service tier is invoked from the web tier through .Net remoting over HTTP. The ServicedComponent classes that are invoked by IIS are wrappers around PONO objects. I would like to use Spring to provide the ServicedComponent with the actual implementation class it delegates to, and would also like to use Spring to manage dependencies within the PONO service objects themselves.

It appears I can setup an IApplicationContext within a singleton object and use Spring as an explicit factory from within the ServicedComponent and PONO classes. Is there a better way? Is there a way to have the dependencies injected automatically without explicitly managing IApplicationContext myself (like there is in ASP.Net through the PageHandlerFactory)?

Thanks
Alistair

Aleks Seovic
04-27-2005, 06:32 AM
Hi Alistair,

Please take a look at http://opensource.atlassian.com/confluence/spring/display/NET/Enterprise+Services+Support and let me know if it helps.

Template referenced by ServicedComponentFactory definition can be used to specify dependencies that you want to inject into serviced component.

Even if you choose not to use ServicedComponentExporter and EnterpriseServicesExporter to dynamically create and register ServicedComponent wrappers around your PONOs, you can still use ServicedComponentFactory and named template to inject object into your serviced component.

Regards,

Aleks