I think there are two issues at stake here:

 

1) It would be very nice not to need to mappings or to have more programmatic control over them.  It’s not (you’re right) too much to ask that a mapping is needed, but it would be nice – people who have written apps for past versions of CF want, it seems, some of the flexibility seen with custom tags – you can choose to map or not and still have a complex application.

 

In any case there are workarounds to programmatically create mappings and I’m sure (well, I hope based on rumor) an official solution will be in the next release.

 

I’m perfectly happy to concede this point (and in fact I’m usually the one arguing your side – I really don’t think a mapping is all that bad).

 

2) There are still name conflicts.  If I distribute an app that requires, say, a DSN and a CFC mapping (probably the minimum needed for most complex apps) I can author that application to use ANY DSN name in case the recommended name is already in use.  I can’t do that with CFCs.

 

The problem becomes most apparent when you consider two users on the same virtual host attempting to install the same application (perhaps two different versions of the same app).  Since the mapping name is hard-coded and system-wide it’s a nightmare.

 

With DSNs I can abstract the system-wide settings so that my application doesn’t need to be aware of them.  We’ve all placed DSN names into the application or Request scope do just that.    Custom Tags and UDFs let me use CFMODULE and CFINCLUDE to make relative calls for the functionality.

 

I may have to edit a config file or ini, but I should never have to touch the application – that kind of coding has been a best practice for years.

 

With CFCs I would have to edit all of the CFCs that reference fully-qualified names (and if you’re using CFC type validation across packages you need to use FQNs) if I couldn’t use the recommended mapping (because it was already taken by somebody else).

 

This is the one that really sticks in my craw.

 

Jim Davis

 

Reply via email to