20.2.6 Project Management

If you are developing a large or complex application, dynamic-link libraries can make your task easier. By splitting an application into clearly defined subsystems, you can logically divide work between different groups of developers. Each subsystem can then be developed as a separate dynamic-link library.

One of the challenges in such a project is defining the interface between each two subsystems. Since dynamic-link code can freely call functions in other dynamic-link modules, Windows imposes no constraints on subsystem definitions. In addition, Windows manages the movement and discarding of code segments to minimize the problems that memory limitations often cause for MS-DOS development projects. To take advantage of this feature, you should define code segments as MOVEABLE, or MOVEABLE and DISCARDABLE, in the module-definition (.DEF) file.

One benefit of using multiple dynamic-link libraries is that, because each library has its own data segment, data corruption between subsystems is minimized. This type of encapsulation is useful in developing large applications.

There is another type of encapsulation, however, that might cause problems in large projects that require multiple applications to run simultaneously. Because each application is treated as if it has its own private address space, applications can move global data to other applications only by using dynamic data exchange (DDE). For more information on using DDE, see Chapter 22, “Dynamic Data Exchange.”