Sharing Code

If you are developing a family of applications, you may want to consider using one or more DLLs. A DLL saves memory when two or more applications that use a common set of DLL routines are running at the same time. DLLs allow multiple applications to share common routines that would be duplicated for each application if static-link libraries were used.

Suppose, for example, that you are creating two graphics applications, one a vector (draw) program and the other a bitmap (paint) application. A common requirement of both programs is the ability to import drawings created by other applications. You could create DLLs for each supported “foreign” file format that would convert it into an intermediate format. Your paint and draw applications could then convert this intermediate data into their own formats. The applications themselves would be required to contain only the code to convert from a single format to their own format. To support the importing of a new file type, you would simply develop a new DLL and distribute it to the user, instead of modifying, recompiling, and distributing the application modules themselves.