Simberon Design Minute
 

Namespace Confusion

Namespaces are supposed to make it easier to mix different components of an application together without worrying that the class names in one component are going to clash with the class names from another component. They can do that but only if they're used properly. We recently ran across a case in VisualWorks where the COM connect classes were referencing a class called Note. The Note class was in the Smalltalk.Tools namespace and the references were in other namespaces like Smalltalk.External. The references were being resolved by having an import of Smalltalk.*. As it turns out, the client had a class called Note and when the COM connect classes were loaded they tried connecting to that class instead and started failing. If you want to make sure your names don't conflict, you have to make sure that the namespace resolution doesn't take a shortcut and find classes you didn't expect.

Download