When placing generic code in a dynamic link library, whether that code is at the application object level or at the functional level, the question arises as to the way in which the code should be partitioned into individual DLL modules, and thus the level of granularity that will be achieved within the reusable code.
This decision must be made on the basis of interdependence; where routines are interdependent and are required or likely to be used together, it is advisable to place them in a single dynamic link library. For example, a group of standard window manipulation routines would typically reside in single DLL.
However, generic application objects should bear no predefined relationship to one another, and generic window classes may therefore be used independently. In such a case, the window procedure and invoking routine for each window class should be placed in a separate DLL, along with any subroutines specific to that window procedure. Applications that desire to use more than one such application object may then access multiple DLLs.