Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to know about actual purpose of DLL creation in application oriented.. Can anyone explain with example?
Posted
Updated 16-Oct-15 1:30am
v2
Comments
CPallini 16-Oct-15 7:33am    
'application oriented' what?

C# is an OOPs language, and some of the important parts of using an OOPs language are that the implementation of an object is not something you need to concern yourself with, and that code reuse (rather than copy and paste) is a good idea.

Creating class libraries (which are DLL assemblies) allows you to do that, and more: the DLL is compiled, and the implementation can't be seen by other assemblies using its classes; the library can be used in many applications; and fixes can be applied without recompiling existing apps.

In addition, it also allows you to "group" concerns together - so your Data Layer might be in one DLL, your Business Layer in another, and your Presentation Layer in a third. When your company decides to switch from CSV file storage to SQL server, you just need to write a new Data Layer and replace the existing assembly. The BL and PL always interact with data via the DL assembly, so they don't even know that such a radical change has been made.
 
Share this answer
 
First you should know what the dll is.
Quote:
A dynamic-link library (DLL) is an executable file that acts as a shared library of functions and resources. Dynamic linking enables an executable to call functions or use resources stored in a separate file. These functions and resources can be compiled and deployed separately from the executables that use them. The operating system can load the DLL into the executable's memory space when the executable is loaded, or on demand at runtime. DLLs also make it easy to share functions and resources across executables. Multiple applications can access the contents of a single copy of a DLL in memory at the same time.
[Read More...][^]

And the use of dll is :
Multiple processes that load the same DLL at the same base address share a single copy of the DLL in physical memory. Doing this saves system memory and reduces swapping.

When the functions in a DLL change, the applications that use them do not need to be recompiled or relinked as long as the function arguments, calling conventions, and return values do not change. In contrast, statically linked object code requires that the application be relinked when the functions change.

A DLL can provide after-market support. For example, a display driver DLL can be modified to support a display that was not available when the application was initially shipped.

Programs written in different programming languages can call the same DLL function as long as the programs follow the same calling convention that the function uses. The calling convention (such as C, Pascal, or standard call) controls the order in which the calling function must push the arguments onto the stack, whether the function or the calling function is responsible for cleaning up the stack, and whether any arguments are passed in registers.

Ripped from here[^] ;)

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900