wirebox binder config question

Hi all.

I have a test configure method in my binder like this:

<cfset map(“hole”).to(“wormhole”).initArg(name=“user”,dsl=“wheels:model:user”) />

I get an error telling me that the component ‘wormhole’ cannot be found; it resides within the location I indicated in my scanLocations array. If I use the full class path, it creates the mapping just fine. If I get an instance of wormhole anywhere else within the app, after initialization, Wirebox DOES use my scanLocations value and will execute getInstance(“wormhole”) just fine.

Does Wirebox NOT look at the scanLocations array during execution of the configure method??? Are we always required to use full class paths within our configure method, regardless of scanLocation values? If it doesn’t use the scanLocations array during configure…think we can change that? Or is there a good reason not to be using them at that point?


Doug B

The to part of the bind needs to be a fully qualified path to the component.

Sorry I didn’t read your question fully.

To fully understand this, the DI could be done at any point of the application. That means the current directory could be anywhere. And to do DI it basically does a createObject to load this into where you want to DI it into.

The scan locations, basically tell wirebox, these are the only directoires that I want to allow this to happen. So if you were to try to do a DI outsief of the scanLocations it will not be injected.

Does that clear it up some more?

Actually you had answered my question the first time. :slight_smile: The issue I was asking about was the fact that Wirebox was NOT taking my scan location into account during it’s own initialization (executing of my binder’s Config method). Which puzzled me…in my mind, it SHOULD take that into account as I create my mappings!

Scan locations use conventions not configuration data. So if you map you must map everything.

Luis Majano
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano