They are also usually developed
manually, similar to libraries and frameworks for the target environment. Code for the
domain framework, however, has different purposes:
. Remove duplication from the generated code. Applications tend to have
similar structures that are speci?¬?c to the type of application we are building, yet
not provided by the target environment. Rather than including these in the
generator, they can be made into domain framework code that generated code
calls. This keeps the generator simpler. For instance, it could be that every
application or feature needs the same data structure or has similar behavior.
. Provide an interface for the generator. The domain framework de?¬?nes the
expected format for the code generation output. The output is not de?¬?ned as
concrete code but more as an example or template that the generator then
produces. In a simple case, when generating XML we could consider the
schema to de?¬?ne the structure for the generated code. In a more complex case,
the domain framework can de?¬?ne data structures that generated code then ?¬?lls.
. Integrate with existing code. Rather than directly calling the services of the
library and its interfaces, a domain framework may be used to integrate with
existing code. For instance, framework code may provide basic behavior as
abstract classes and the generated code creates the subclasses or implements
stack management that the generated code uses.
Pages:
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190