In our daily life we find so many libraries like book library means collection of books then cd library means collection of cd’s video library means collection of videos. Similarly class library means collection of classes where every class will contain so many pre-defined functions which are helpful to write code in .net.
Class libraries in .net are also known as “Assemblies”.
Class libraries /assemblies in .net are very much similar to packages in java.
Class library is known as building blocks of application in .net.
Class library in .net are also known self describing in nature Microsoft maintence particular hierarchy to the class libraries.
This hierarchy especially use full in the following things.
1. To provide easy access to the predefined functions
2. To Avoid duplicate naming problems
To Access any predefined functions we need to this hierarchy like namespace. Class name. Predefined function name.
Difference Between Assemblies And Name spaces:
|An assembly is a collection of similar group of class||Namespace is also collection of similar group of class|
|An assembly contains one or namespace within .Net||A Namespace never contain the assemblies|
|An Assembly is physical entity||A namespace is an logical entity|
|Creating an assembly is compulsory||Creating Namespace is optional|
1. User defined class librariesA class library can be divided into 2 categories
2. Base class libraries.
2.User defined class libraries
There are created by the programmer for reusability purpose with in Application/program.
2.base class libraries:
These are created by Microsoft
These are installed into system when we install .net framework
From windows 7 on words framework is available with windows os only.
Physical location of BCL is “C:\windows\Assemblies”
Any class library/assembly in .net will exist in the form dll/exe.
A dll is a dynamic link library which is used as supporting file for other files. Library function to the linked Application at run time.
Dll doesn’t contain any main method so dll can’t run independently.
An exe is executable file if self and application and not used as support file an exe contains entry point/main method so exe run’s independently.
Difference between DLL&EXE
|Can’t run individual||Run individual|
|Used an supportive file forother application||It is self application|
|Doesn’t contain any entry point (main function) so can’t run individual||It contain entry point method so it will run individual|
|Os doesn’t create a separate process for any dll rather .dll will run in same process for an exe||Os create a separate process for each exe it execute|
|A program/Application without main method create a dll after compilation||A program/application with main method creates an exe after compilation|