External Model Mappings

We are using ColdBox for three separate applications now that share a
lot in common (like the entire business layer and data layer) so we
have been sharing as much as possible between the apps. (javascript,
view, and handlers where appropriate) We are using the same model for
all the apps and have employed the ModelsExternalLocation setting to
help with that. Every change to our model though means I still have
to update all three of my modelMappings.cfm files to match.

While I understand it would be possbile to share the same model
between the apps and map them to entirely different names I can't
think of any really good reason to torture muyself like that right

Therefore I'd like to suggest a ModelMappingExternalLocation setting.

looking through the beanFactory plugin I see that it uses
getSetting("ApplicationPath") & "config/modelMappings.cfm"
to find the model mappings. It should be rather simple to add a fall
back so if that location isn't found, it would resort to an external
location instead.

Now, that approach would require ALL of the model mappings to be
duplicated locally even if only differed from the external location.
Overriding specific mappings sounds like a bit more of a pain, so I
would be just happy with the simple solution.



HI Brad,

Thanks for the input. I can see your concern and it makes total sense.

Let me make note of this and see how we can make this happen for the next release.

Please always send us your suggestions on model integration, on how it can be even better as we are still developing it.

I am even thinking of making it part of the IOC settings also. Basically, the IOCFramework by default would be coldbox and then the IOCDefinitionFile setting would be “config/modelMappings.cfm” by default, but then it can be overrided to point wherever. Also, we are thinking of making it a cfc. Something like ModelConfig.cfc or BeanConfig.cfc

What do you think?