Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do an assembly have multiple namespaces or is composed of single namespace

Can an assemble have multiple namespaces or is composed of single namespace.

like image 943
Shantanu Gupta Avatar asked Apr 27 '10 15:04

Shantanu Gupta


3 Answers

  • An assemblies is a collection of code - objects, methods, properties, and other resources.
  • A Namespace is a logical groupings of those things.

An assembly can contain multiple namespaces, because it can contain multiple logical groupings of objects and methods. Most assemblies I've seen are a single namespace, just for clarity, but there's no reason a single assembly couldn't contain a dozen different namespaces.

like image 53
SqlRyan Avatar answered Oct 05 '22 01:10

SqlRyan


The hierarchy is: Assemblies contain Resources and Modules.

Modules contain Fields,Methods, and Types.

Types may be qualified by any arbitrary namespace, provided that it doesn't conflict with another existing Type.

Assemblies can short circuit past the Module level directly to all Types contained in all Modules in the assembly (via GetType() or GetTypes()).

like image 43
plinth Avatar answered Oct 05 '22 03:10

plinth


Assemblies can have multiple namespaces.

like image 31
Tejs Avatar answered Oct 05 '22 01:10

Tejs