Tuesday, August 22, 2006

How to Inject Dependencies Into Domain Objects When Using the Spring Framework 1.x and Hibernate

This story has moved to NerdBoys.com. Please read this story at its new location.

4 comments:

schmoely said...

We started doing things exactly like this last year.

The idea has been really well adopted inside our organisation and we are yet to work out why this approach has not been pimped elsewhere.

AOP is nasty.

James said...

This is a great idea... especially since the code required to integrate Spring Framework 2.0/Hibernate/AspectJ for domain object injection is still in the sandbox apparently.

memeplex said...

Well, at least there are other people that have come to the same (imo obvious) solution. I was scared about adopting it, I thought that there must be something terribly wrong with the approach because nobody was even mentioning it, despite its simplicity. Glad to hear you have (successfully?) done this. I've recently posted about the idea at the spring forum http://forum.springframework.org/showthread.php?t=48311,
before knowing about this blog. Maybe a custom tag like /staticdependency class="X" name="X" ref="X"/ will be valuable in order to reduce the xml noise.

Joe said...

Thanks Memeplex!