Program generators and component-oriented programming go hand in hand. Components and their composition into systems involve some significant problems. Finding just the right component is difficult if software-reuse libraries focus on single components rather than component families. Component families can be developed by taking advantage of design-time and run-time properties. When those are insufficient, generation-time variabilities can be used to design program generators for creating customized components for every occasion. A second major obstacle to component-oriented programming is configuring and connecting components up to create a software system. Connections between components may require sophisticated interface adapters that can take into account such things as parameter conversions, defaults for optional parameters, synchronous and asynchronous connections, and other communication mechanisms. Writing this interface code is tedious and error prone. It should be left to the expertise of a MIL program generator. Finally, building such tools and systems is not difficult. It may be difficult to design a good language or system, but it is not difficult to build the tools using the techniques described in this book.
Example 13-1: The ShoppingCart Java Bean
|