An Architect's View

CFML, Clojure, Software Design, Frameworks and more...

An Architect's View

DI/1 0.1.7 available for testing

October 16, 2011 ·

Things are moving along with DI/1 now that FW/1 2.0 is close to Gold status and you can download version 0.1.6 0.1.7 now (0.1.7 fixes a bug in 0.1.6 that could cause problems on Adobe ColdFusion 9.0.1). I'd still consider it pre-release but it's getting close to a true Alpha release with only one (hard) open issue to solve. Recent changes include:

  • Handling of properties in persistent (ORM) beans has been fixed (so persistent="true" implies accessors="true").
  • Various bug fixes and enhancements in the handling of mapped paths. Issue #3.
  • Additional folders can be declared as containing transients (in addition to the beans folder convention).
  • More control over the singular form of folder names is provided.
  • API isSingleton(name) returns true if the named bean is a managed singleton.
  • API getBeanInfo(name) returns the DI metadata for the named bean. getBeanInfo() returns all the DI metadata in the factory. Framework authors may find this useful.
  • API addBean(name,value) allows you to programmatically tell DI/1 about name/value pairs so non-bean values can be supported. This is also available as a 'constants' configuration when DI/1 is initialized. Issue #6.
  • API declareBean(name,dottedPath,[isSingleton=true]) allows you to programmatically declare CFCs that are not inside folders that DI/1 is managing automatically. Issue #13.
  • Transients are no longer injection via setters (or property declarations). The prior behavior caused confusion and could lead to strange behavior if you have several related beans (as happens with ORM). Issues #14, #15.
  • Singletons are now cached under their qualified name so, given services/product.cfc, requesting getBean("product") and getBean("productService") both resolve to the same instance. Issue #16.

Not all of these features have made it into the documentation wiki yet. I'll be updating that tonight! The documentation has been updated to match the new features and changes.

Tags: coldfusion · di1

2 responses

  • 1 James Mohler // May 25, 2012 at 10:34 AM

    Any status updates?
  • 2 Sean Corfield // May 26, 2012 at 10:54 PM

    Indeed. By the end of December 2011, DI/1 had reached v0.3.0, with the addition of an MXUnit test suite and an onLoad() event / listener. I'm a bit surprised I didn't blog about it :(

    I'm close to the point where I could replace World Singles' use of ColdSpring with DI/1 and when that is possible, I will declare a 1.0 release.

    I've been kept pretty busy with World Singles work so far this year which has slowed down work on FW/1 and DI/1...