Você está na página 1de 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.

Você também pode gostar