Dave Ross on Inversion of Control
December 27, 2004 · 3 Comments
Dave Ross talks about how he's been using Hibernate, JSF and Spring and how Spring's Inversion of Control mechanism could translate to ColdFusion. When I saw the XML-based <bean> definitions in Dave's post, it made me wonder whether something like this should become part of a future version of either Fusebox or Mach II...
Tags: coldfusion

3 responses so far ↓
1 Dave Ross // Dec 27, 2004 at 4:41 PM
For mach-ii, the approach I took was to use a plug-in to instantiate and configure the bean factory, then put it into the property manager to be retrieved & used by any mach-ii component. I'm not sure how that would relate to FB4, because I haven't ever used it.
Another goal of mine is to be able to merge a real (java) spring bean factory with my cfc-based version, the goal being calling code getting either a CFC or java instance based on what's defined in the factory (so you could swap CFCs for Java classes without changing calling code). I'm doing this for an upcoming cold fusion project that is slated to leverage and build upon an existing java code base.
I'll send you what I have tommorrow (whether you want it or not, I need feedback bad! :)
2 Maxim Porges // Dec 27, 2004 at 10:08 PM
Spring's IoC approach is so intuitive and easy to use. I did think about how useful a version of this for CFCs would be, but felt like it was reinventing the wheel to some extent. Plus, many of the problems that Spring solves for Java (datasource wiring, transaction management, etc.) are inherent to the ColdFusion app server, and therefore the benefits didn't seem as great as they are with Java.
It's nice to see that other people are working towards this approach with CF - I think Spring and ColdFusion are a great match. If an IoC container for CFCs were to come to light I think it could be put to a number of useful applications.
- max
3 Robby // Dec 28, 2004 at 3:02 AM
And Dave, if you're still needing feedback, shoot me an email, I'd be happy to help over the holidays.
Leave a Comment