Sean, I’ve never used a custom WireBox DSL namespace, so I can’t answer authoritatively but after perusing the code, I don’t see how you would be able to override an existing namespace.
In coldbox/system/ioc/builder.cfc in the buildDSLDependency() method, all the “normal” namespaces are checked first (like entityServiceand) and delegated to other methods (like getEntityServiceDSL
()).
It isn’t until the list of normal namespaces has been exhausted, that the customDSL is checked which is where your custom builder kicks in.
If I were to guess, I’d say that the docs are wrong. It would be possible to change WireBox and allow the custom DSLs to override the internal ones by reversing the order of the lookups, but I’d like to hear Luis weigh in.
In the meantime, you may be able to create an intermediate mapping ID in your config which points to either the entityService or your own builder and then autowire that ID into your components. I don’t think that will allow you to do two-stage DSLs though like inject=“entityService:person”. You could just map(“myEntityService”).toDSL(“entityService OR mongoEntityService”) and then autowire inject=“myEntityService” but NOT inject=“myEntityServiceL:person”
Thanks!
~Brad
ColdBox Platform Evangelist
Ortus Solutions, Corp
E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com