Declaring Namespaces
A namespace enables you to group logically related classes. You are not required to provide a class with a namespace. To this point, all the components you have seen created have been members of the global namespace. However, several advantages result from grouping components into namespaces.
First, namespaces prevent naming collisions. If two companies produce a component with the same name, namespaces provide you with a method of distinguishing the components.
Second, namespaces make it easier to understand the purpose of a class. If you group all your data access components into a DataAccess namespace and all your business logic components in a BusinessLogic namespace, you can immediately understand the function of a particular ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access