DLL  
 
Dynamic Link Library - A function library that is linked into applications at runtime.

Traditionally, function libraries have been linked to applications statically, when the applications are compiled.

Why use DLLs?

The advantage of dynamic linking over static linking is that a single library of common functions can be shared among multiple applications. Functions that many applications have a common need for might include functions to do communications over the web, functions to do common math problems, or functions to do database lookups. There are actually many common tasks that can be kept in a library to be dynamically (or statically) linked into diverse applications.

Disadvantages of using DLLs

The disadvantages of using shared, dynamically linked libraries are caused by the very fact that they can be shared. In Windows(tm) problems arise because of cumulative updates of existing applications and additions of new applications that use common DLLs. Because DLLs are shared among multiple applications, and each application may need a different version of the same DLL, a huge mess ensues. For example an existing application may stop working when a new application is installed that installs its own version of a shared DLL. Another source of difficulty can occur in Windows(tm) machines when a new application is installed that changes the registry settings for the existing DLL.

Advantages, disadvantages, and history

There was a time when RAM and hard drive space were very expensive and sparse on typical machines. In those days, anything that could reduce RAM and disk space usage was considered a good thing. Shared function libraries meant each application did not have to carry all the functionality it needed and could be much smaller. In these days of low cost RAM and DISK storage though, there is very little advantage to sharing functions, and (as discussed above) there are huge disadvantages.


But...

In modern systems, there is still an advantage to using DLLs over statically linked functions, when they are used only by a single application. In this case, because the libraries aren't shared with other applications there are none of the usual problems associated with sharing them. Here, the application can be made to load and start faster, only pulling in the dynamically linked functions if and when they are needed. Also, multiple instances of the same application, running on a single machine, can all use a single loaded DLL, speeding load/run times and reducing resource usage on busy application servers. The key in this case, is that it is multiple instances of the EXACT same application (including version).




 
  Sockets     CLI     API
 


Content: © Copyright 2000-2007 Creativyst, Inc. (all rights reserved)

 

index
Record date: 2006.10.06-1538