Saturday, September 17, 2005

Cheap Dependency Injection with Struts Chain

I recently found a situation where I wanted to change some inheritance into delegation for a Struts Action class. I needed to create a base delegate class to hold the common information that my struts actions needed. Struts chains was already being used so, I simply added an interface defining a setter for the base delegate object. In an object that was monitoring via the struts chain, I check to see if the action being called implements the Delegate Interface and if it does, I call its setter with a new Delegate Object. I have to say that even though I really don't care for struts, the Struts Chain is pretty cool.

0 Comments:

Post a Comment

<< Home