Archived

This topic is now archived and is closed to further replies.

Kyo

What's the advantage of using a .dll...

Recommended Posts

Kyo    154
...As opposed to just including the headers or libs and compiling it into the .exe? At what point should I start thinking about using a dll?

Share this post


Link to post
Share on other sites
kuphryn    210
DLL can help better organize objects. For example, let say have designed and implemented a username/password dialog box. Notice that under a Windows environment, username/password dialog box look exactly alike. One solution is to host the dialog box in a DLL.

DLL is essential server in COM designs.

Kuphryn

Share this post


Link to post
Share on other sites
falkone    444
To elaborate on the above post... take an oft-patched game like everquest. If they had everything in the .exe file, any slight change could result in a 15mb file download.. now if they''re in 15 different dll files (a bit extreme).. it''d only be a 1 mb download... much more convenient.. you also don''t have to recompile 300,000 lines of code, only perhaps 20,000

Share this post


Link to post
Share on other sites
Dwiel    365
A major thing, which has already been mentioned is compile times... If you have a large program, it becomes a very large pain when it takes a couple of mins to compile...

Also, It makes them easy to test. You can test each dll independentally and so it allows you to sometimes more easily identify where bugs are located. They are then also much easier to reproduce when you can wip up a program that loads up the dll and then performs the operations you think are causing the problem. This is much more preferable than say playing your game until you get 15 coins and talk to the old lady... you know what I mean... it is easier to reproduce events even if they are artificial when you have that much more control over each class...

Dwiel

Share this post


Link to post
Share on other sites