Adding to what others have said...

If your component depends on Reactor, it's preferable to hand that
dependency into the component* instead of having the component reach
out and find the Reactor in a predetermined spot.

There are plenty of reasons why you may decide not to put Reactor in
application.reactor, e.g.:

- Your service layer is already in the application scope.
- For testing/debugging, you want each request to have its own copy of reactor.
- For unit testing, you want to replace reactor with a mock or a stub.
- The application has more than one instance of reactor (for different
data sources, maybe?)
- Some other component expects to find Reactor in application.reactorFactory
- You deploy on a nuclear submarine.

Patrick

* Which is a not very sexy way of saying "inject the dependency."



-- 
Patrick McElhaney
704.560.9117


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to