ModelsExternalLocation ??

Hi,

I wanted to know what is the benefit of using the
ModelsExternalLocation setting in the Coldbox config? It seems you
can already create a mapping in CFAdmin and have an external set of
components shared across apps anyways. Is it really just a variable
stored in Coldbox.cfc to make things easier?

Thanks,

Yes, the models external location is a feature called package scans. You basically give it an array of packages the internal factory (wirebox) will scan for objects. When you request an object via getModel(), wirebox will scan the locations you set IN ORDER. if not found, it will just try to create the object.

This gives you the ability to feed packages into wirebox so you do not have to declare a configuration file for all your objects and dependencies. It is a convention way to get objects and then wire them by “inject” annotations. wirebox supports this as I describing it, but it will also support a configuration approach.

So it is not mandatory, but it just basically accelerates lookups as you are telling the framework where to search in a specific order. If the setting is blank, then it searches the “model” convention in your app first and then the rest of the server if not using aliases.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com