Application Specific Mappings Are Horribly Broken

written by Geoff Bowers on Friday, 7 December, 2007 @ 10:42 AM


Application Specific Mappings are a furphy and do not work as advertised in CF8. If you thought that Application.cfc mappings feature allowed you to override ColdFusion mappings you'd be wrong. cfimport, "extends" and "implements" do not adhere to application specific mappings as defined in Application.cfc.

As a consequence of the way ColdFusion templates are compiled, an Application.cfc mapping is not the same as an Administrator configred mapping.

Sean Corfield puts this eloquently:

They can't possibly: per-app mappings are a *runtime* construct attached to a notional CF application. <cfimport> and extends= are *compile-time* constructs applied to a specific file. You cannot possibly have the compile-time behavior of a file depend on run-time settings in another file - how could you use the same file (.cfm/.cfc and associated .class files) from multiple applications??

I think my biggest complaint is the way this was advertised -- ie. as an application specific cf mapping. Obviously it is not. You'll find the misinterpretation is very wide spread and the documentation does nothing to dispel the myth.

With respect to CFIMPORT it just repeats what was in CF7's doco. As for Application.cfc mappings... this set of comments tells it all.

isaac dealey said on Oct 11, 2007 at 5:29 PM:
There doesn't seem to be any mention of this.mappings for setting application-specific mappings in the Application.cfc anywhere in the Application.cfc reference -- or for that matter -- in the documentation anywhere as far as I can tell.

halL said on Oct 12, 2007 at 6:31 AM :
Isaac dealey is correct. The mappings variable was left out of the Application variables table. You can find information on using This.mappings at:
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=appFramework_04.html

If you follow the link provided you get this summary:

These settings override the server-side settings in the ColdFusion Administrator for the specified application only. Specifying per application settings does not change the server-wide settings. To set per-application settings, you must first enable per-application settings on the Settings page of the ColdFusion Administrator. You then set the mappings or custom tag paths in the Application.cfc file.

Probably a language barrier, me being Australian and all, but it seems very misleading to a dumb yokel like myself ;)

Perhaps in hindsight, a compile-time config would have been more worthwhile.

 

Comments

Permalink: http://blog.daemon.com.au/go/blog-post/application-specific-mappings-are-horribly-broken

Options:

Size

Colors