As Figure 12 suggests, application frameworks reduce the total amount of code that a programmer has to write from scratch. However, because the framework is really a generic application that displays windows, supports copy and paste, and so on, the programmer can also relinquish control to a greater degree than event loop programs permit. The framework code takes care of almost all event handling and flow of control, and the programmer's code gets called only when the framework needs it--to create or manipulate a proprietary data structure, for example.
A programmer writing a framework program not only relinquishes control to the
user (as is also true for event loop programs), but also relinquishes the
detailed flow of control within the program to other programmers--namely, those
who wrote the framework. This approach allows the labors of different programmers
to be combined to create more complex systems that work together in interesting
ways, as opposed to isolated individuals creating custom code over and over again
for similar problems.
[Contents]
[Previous]
[Next]