0% found this document useful (0 votes)
117 views1 page

Name Space

A namespace is a conceptual space for grouping identifiers to avoid conflicts. When two namespaces have the same name, the corresponding compiler uses the specified namespace instead of the type. Namespaces should be named using a company name followed by department and technology, separated by periods.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views1 page

Name Space

A namespace is a conceptual space for grouping identifiers to avoid conflicts. When two namespaces have the same name, the corresponding compiler uses the specified namespace instead of the type. Namespaces should be named using a company name followed by department and technology, separated by periods.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

What is a namespace? What happens when two namespaces having the same name?

A conceptual space for grouping identifiers, classes etc. for the purpose of avoiding
conflicts with the elements of an unrelated code which have the same names.
When two name spaces are having same name, the corresponding compiler uses our
name spaces instead of the type.

What are the guidelines of using namespaces?


To name a namespace, utilize the company name followed by the department and
optionally followed by the features and technology used.
For example:
MyCompany.Media.Design
The following are some guidelines to name namespaces.
• The prefix of company name avoids the possibility of two or more namespaces
with same name.
• Use a stable, noticeable department or technology name followed by the company
name at the hierarchical name of second level.
• Use organizational hierarchies as the basis for name space hierarchies.
• Separate the logical components with periods (.).
• Avoid giving same name for classes and name spaces.

What is name lookup?


A name lookup is a name in the specified logically grouped names in the namespace,
using scope operator (::). The compiler tries to look up the name in the specified
namespace through the scope.

You might also like