Module issue i found

Finally creating new application with 3.1 using modules and exited.
one thing i found in the service injection i i found that i have three
modules all of them have a service call facade.cfc inside the Model
folder, if i call my facade injection from my Module1 i am getting the
instance of Module3 model folder. Is this bug. i was expecting from
the same module

This is to be expected because you are leveraging the conventions to scan your locations for objects.

Basically, when you say getModel(“service”), that service if not binded as a key, will be searched in the following locations:

  • Parent model folder
  • WireBox scan locations
  • Modules “model” folder (in order of layout in the OS)

As best practice when leveraging modules is to create named keys for your objects in order to retrieve what you need in the module config object.

// direct mapping
binder.map(“MyService@MyModule”).to(moduleMapping & “.model.MyService”);

Luis F. Majano
President
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano