Forums » .NET » .NET »

Difference between Namespace and Assembly ?


Posted Date: 16 Mar 2006      Posted By:: kamal tuteja     Member Level: Bronze    Member Rank: 0     Points: 2   Responses: 5



Hi,

Plz tell me in detail what is the Difference between Namespace and Assembly ?


Kamal Tuteja




Responses

#44391    Author: Sukanya       Member Level: Gold      Member Rank: 190     Date: 16/Mar/2006   Rating: 2 out of 52 out of 5     Points: 2

Assembly will contain Namespaces,Classes,Data types it's a small unit og code for deployment.
Namespace is used inorder to avoid conflict of userdefined classes


 
#84645    Author: DeepashriRavindran      Member Level: Bronze      Member Rank: 0     Date: 09/Oct/2006   Rating: 2 out of 52 out of 5     Points: 2

Namespace:
1) it is a Collection of names wherein each name is Unique.
2)They form the logical boundary for a Group of classes.
3)Namespace must be specified in Project-Properties.

Assembly:
1) It is an Output Unit.
2)It is a unit of Deployment & a unit of versioning.
3)Assemblies contain MSIL code.
4)Assemblies are Self-Describing. [e.g. metadata,manifest]
5)An assembly is the primary building block of a .NET Framework application.
6)It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files).
7)All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.

-DeepashriRavindran


 
#147693    Author: akshatha naik      Member Level: Bronze      Member Rank: 0     Date: 30/Aug/2007   Rating: 2 out of 52 out of 5     Points: 2

Namespace: It is a Collection of names wherein each name is Unique.
They form the logical boundary for a Group of classes.
Namespace must be specified in Project-Properties.

Assembly: It is an Output Unit. It is a unit of Deployment & a unit of versioning. Assemblies contain MSIL code.
Assemblies are Self-Describing. [e.g. metadata,manifest]
An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.
.NET Assembly contains all the metadata about the modules, types, and other elements it contains in the form of a manifest. The CLR loves assemblies because different programming languages are just perfect for creating certain kinds of applications. For example, COBOL stands for Common Business-Oriented Language because it is tailor-made for creating business applications. However, it is not much good for creating drafting programs. Regardless of what language you used to create your modules, they can all work together within one Portable Executable Assembly.
There is a hierarchy to the structure of .NET code. That hierarchy is Assembly -> Module -> Type -> Method.
Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.
Assemblies also allow Side-by-Side execution, 2 versions of same assembly can be used at the same time.





 
#154466    Author: Vijayaragavan.R      Member Level: Bronze      Member Rank: 0     Date: 28/Sep/2007   Rating: 2 out of 52 out of 5     Points: 2

Following are the differences between namespace and assembly :

1). Assembly is physical grouping of logical units. Namespace logically groups
classes.
2). Namespace can span multiple assembly.


 
#194695    Author: Anuritha P      Member Level: Bronze      Member Rank: 0     Date: 26/Feb/2008   Rating: 2 out of 52 out of 5     Points: 2

Namespace --is a logical naming scheme for types in which a simple type name is preceded with a dot-separated hierarchical name. Such a naming scheme is completely under the control of the developers. For example, types MyOffice.FileAccess.f1 and MyOffice.FileAccess.f2 might be logically expected to have functionality related to file access. The .NET Framework uses a hierarchical naming scheme for grouping types into logical categories of related functionality, such as the ASP.NET application framework, or remoting functionality. Design tools can make use of namespaces to make it easier for developers to browse and reference types in their code.

The concept of a namespace is not related to that of an assembly. A single assembly may contain many types whose hierarchical names have different namespace roots, and a logical namespace root may span multiple assemblies. In the .NET Framework, a namespace is a logical design-time naming convention, whereas an assembly establishes the name scope for types at run time.

Namespace: It is a Collection of names wherein each name is Unique.
They form the logical boundary for a Group of classes.
Namespace must be specified in Project-Properties.

Assembly: It is an Output Unit. It is a unit of Deployment & a unit of versioning. Assemblies contain MSIL code.
Assemblies are Self-Describing. [e.g. metadata,manifest]
An assembly is the primary building block of a .NET Framework application. It is a collection of functionality that is built, versioned, and deployed as a single implementation unit (as one or more files). All managed types and resources are marked either as accessible only within their implementation unit, or by code outside that unit.

.NET Assembly contains all the metadata about the modules, types, and other elements it contains in the form of a manifest. The CLR loves assemblies because different programming languages are just perfect for creating certain kinds of applications. For example, COBOL stands for Common Business-Oriented Language because it is tailor-made for creating business applications. However, it is not much good for creating drafting programs. Regardless of what language you used to create your modules, they can all work together within one Portable Executable Assembly.

There is a hierarchy to the structure of .NET code. That hierarchy is Assembly -> Module -> Type -> Method.
Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

Assemblies also allow Side-by-Side execution, 2 versions of same assembly can be used at the same time.

References ALWAYS contain names which are ASSEMBLY names of External Dependencies in the Project.
code-construct for Attribute [attribute for assembly]
[Assembly: office name]
[Assembly: configuration]


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Return to Discussion Forum
Start new thread

Subscribe to Subscribers
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Talk to Webmaster Tony John

Online Members

Pawan Awasthi
More...
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India