RE: [coldbox:9639] Re: using getMyPlugin within a serviceObject

To change the subject slightly, when using the “model” namespace in your DSL, the name of the model isn’t required in the DSL. Instead, if omitted, it will assume the “name” attribute is the name of the model like so:

is the same as

assuming that you want to reference the injected dependency as “variables.myModel”. Reference Builder.getModelDSL()

Is there a good reason why the coldbox DSL can’t behave the same way?

For instance, enhance ColdBoxDSL.getColdboxDSL() such that

is the same as

It would require some internal juggling since some of the DSL-building methods are agnostic about the property name and they are only handed the DSL definition. ColdBoxDSL.process() would need to pass along the name as well as the definition.

Thoughts?

Thanks!

~Brad

I had the same thought as I typed the answer. I can’t think of any reason for them to work differently. Do you want to change it and do a pull request.

Curt