Popular DLLs: About this site |
What Are DLLs?The first thing you need to know is what the letters stand for: Dynamic Link Library (according to Microsoft, at least in the past. Now they some times refer to them as application extensions). I think a more grammatical and clear name is Dynamically Linked Library.Before I go deeper, lets cover a little background. When your computer runs a program, at the lowest level it is simply executing one simple instruction after another. And when I say simple, I mean simple, such as "add this number to that, or check if this number is smaller than that one." This is usually not the level at which humans like to think. When we walk across a room, we think at a higher level ("walk!", not "move this leg up and forward like so by contracting this, this, and this muscle while relaxing those two muscles", and so on). In modern programs we try to do the same thing. We write many simple instructions, which have a relatively complex goal, such as drawing a line on the screen. Then we group these instructions in what we call a function, so that when ever we want to draw a line we can use the function instead. We do this by "calling it" which really just means telling your computer "now execute this code", perhaps first giving it some general instructions, like what color to draw the line. This was a great advance in computing, one that happened very early
on, for several reasons. One, it makes programming much easier -
you just write one complex
Before long we had libraries, which contain collections of functions that usually carry out similar tasks. When you wanted to use those functions, you added them to your program, increasing the size of the application, and its memory usage, but at the same time, making life much more easy for the programmer. Note that the library really only exists from the programmers point of view. When they create the application they add all the code from the library into the executable. The program you get is self sufficient, and, as far as you can tell, uses no libraries. The latest innovation is the dynamically linked library. Much like a library of old (now called a "static" library), these functions are not included in the program's executable. Instead, they are stored in a common repository where individually programs can "link" to them, and use their functions to perform tasks. Both the program and the DLL must still be loaded into ram, but an obvious advantage rises when more than one program uses the library. You only need have one copy of the DLL in ram (and only store one copy of it on the disk), no matter how many applications need to make use of the functions offered by the library. Perhaps you now see where the name comes from - in the past, all library code was "statically" linked into an application, that is, it became part of it. With DLLs, the linking happens when the app is run, and only lasts as long as the program is in memory. In modern times, memory is cheap, and many people think DLLs should be eliminated. I disagree, because they offer advantages beyond saving memory. Read more about this in the Why I like DLLs section.
|