Paul Roe said the following on 3/9/2006 5:20 PM:
> Based on your responses I'm left with the conclusion that it doesn't
> matter if what I'm trying to do is possible or not, I just shouldn't
> do it.  Right now I am just experimenting with this framework, getting
> to know it if you will. It is good to learn these best practices that
> you all are providing, however, I guess my real question is still left
> unanswered. Is this possible, without hacking the framework?
I trying to get to the gist of your original question.  Are you asking
if ColdSpring can inject its' own bean factory/container into an
ColdSpring managed object?

If that is your question, I am not aware of if that is possible within
ColdSpring.  However, on that note, I would not think it would be a good
idea even if you could do that.  Reasons: why would you want to self
manage something that ColdSpring already does and could only do better
than you could (otherwise you've reinvented the wheel so to say).

On the other hand, if you question was Can I inject the ColdSpring bean
factory/container into an object that isn't managed by ColdSpring?  The
answer would be yes just use wherever you store the bean factory in the
first place (application, server, etc).

I tend to rely on the auto-wire functionality for my Mach-II related
objects (listeners, filters, plugins), but to prefer to explicitly
define all my relationships for objects that are managed by ColdSpring
(like having an addressService in which the addressDAO is injected by CS
- CS manages both those objects).

The real question in my head is why you want to inject the ColdSpring
bean container into a ColdSpring managed object.  What does this object
do that you want to pass the CS bean container into?

> This still doesn't negate the fact that in order to use coldspring in
> the same manner that mach-ii uses it I will have to manually pass the
> coldspring factory into my service rather than just specifying that
> the service requires a coldspring factory as an argument and allowing
> coldspring to pass itself into my service/listener. 
I think the preferred method would be to create a setter in your
listener and let it auto-wire itself at least in Mach-II.  If it was
another object (meaning framework agnostic), I would let ColdSpring
manage it and then get the bean from the contain instead of the other
way around.

.Peter

-- 
Peter J. Farrell :: Maestro Publishing
Member Team Mach-II :: Member Team Fusion
http://blog.maestropublishing.com

Create boilerplate beans and transfer objects for ColdFusion!
Fire up a cup of Rooibos!
http://rooibos.maestropublishing.com/



Reply via email to