|
|
|
|
A solution is to organize code into named packages. In C++, the feature equivalent to Java's packages is
C++ namespaces.
Then, when class names conflict among different code libraries, we can explicitly place the code in separate packages, and qualify the name references with the appropriate package name. The namespace represented is arranged hierarchically in terms of packages and sub-packages of a package, etc. For example, here is a reference to a method in the Java class library: java.lang.String.substring() where:
And here is a (mythical) reference to a vendor's class library method: COM.Aardvark.eng.gui.Menu.add(String s) where:
Note that the convention is to use the organization's Internet domain names in reverse order. For example, common names might look like: COM.Microsoft... COM.Oracle... COM.Borland... COM.Symantec... However, lots of vendors omit the COM., or just use their company name as the first name. Also, some vendors use
|
|
This page was last modified on 02 October, 2007 |