Framework Headers And NT Compile Time

This document describes a problem WebObjects developers may encounter while developing applications using custom frameworks. This problem occurs on Windows NT for WebObjects 3.1, 3.5.1, 4.0, and 4.5.
When building custom frameworks, many OPENSTEP and WebObjects developers working on the OPENSTEP for Mach platform use framework headers, combined with pre-compiled headers, to speed up the development cycle. A framework header is a header that include definitions for all classes in a framework. Together, these two elements can result in quicker compiles and eliminate the need to use separate #import or #include statements for each class your project uses.

Under Windows NT, pre-compiled headers are not an option. However, using unstripped framework headers for custom frameworks causes an increase in DLL size for each #import statement. This can increase compile time, slow down the debugger, and slow your development cycle substantially. Each header file which imports a framework will increase the size of the DLL. Therefore, unless you are using a framework with stripped headers, such as Apple's Foundation and WebObjects frameworks, always use a separate #import or @class statement to include only those files needed by a specific header. For example, instead of

#import <MyFramework/MyFramework.h> //import every header in the framework
use the faster:

#import <MyFramework/SomeClass.h> //a class need by this object
#import <MyFramework/OtherClass.h> //another class needed by this object

Published Date: Feb 20, 2012