NamedBuildKey case sensitive-ness

Feb 15, 2008 at 1:37 PM
Should the name part of the NamedBuildKey be case-insensitive?

When the service name to lookup comes from a web query, there's high chances casing won't be right and service won't be found.

And anyways, supporting 2 different instances to differ only by their name casing is asking for trouble.
Feb 15, 2008 at 9:55 PM
I'm not sure you should be passing web query information directly into a container anyway - at the very least some normalization / validation should take place before going to the container. In that case the easy answer would be to .ToLower() the query before calling the container, and make sure to register with lower-case names only.

However, while I may disagree with your particular scenario, the question in general about case sensitivity is a good one. I've got over a decade of C/C++ experience that has trained me to be case sensitive. What's the case for insensitivity? Does anyone else thing it should be case-insensitive? Does anyone know what other containers do on this?

-Chris
Feb 20, 2008 at 10:57 AM


ctavares wrote:
I'm not sure you should be passing web query information directly into a container anyway - at the very least some normalization / validation should take place before going to the container. In that case the easy answer would be to .ToLower() the query before calling the container, and make sure to register with lower-case names only.

However, while I may disagree with your particular scenario, the question in general about case sensitivity is a good one. I've got over a decade of C/C++ experience that has trained me to be case sensitive. What's the case for insensitivity? Does anyone else thing it should be case-insensitive? Does anyone know what other containers do on this?

-Chris



Chris
While you cite experience with C/C++ training you to be case sensitive, this experience is in the context of a full language with the associated error reporting available from the compiler. When dealing with configuration systems, unless that same level of error reporting is available to inform the operations staff/person changing the config files, exactly what file and line number errors occurred on, the better approach is case-insensitivity.

I don't see Unity having the resources to provide that level of error reporting for the configuration system at this point and frankly I am not sure it would be worth it.

In short I would MUCH rather see case insensitive names.

As to what other containers do, I believe Windsor ignores case.

-mark
Mar 5, 2008 at 5:39 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.