Building a domain framework with inverted control can start right from the
beginning of the code-related phase of DSM. Back in Section 11.1 at the start of the
Generators chapter, we saw how writing a small example application in the domain
was a useful ?¬?rst step. The simple approach shown there reduced this application into
a generator that produced most of it, and a model that supplied the values that varied
PROVIDING AN INTERFACE FOR THE GENERATOR 325
between applications. Later, we saw how frequently encountered or long blocks of
code in the generator could be separated out from the generator into components.
However, this clearly leads to a situation where the generated code is calling the shots,
invoking components as needed.
To invert control, we can look at the example application from a different point
of view. What parts of it show the ?¬‚ow of control and execution architecture that
will be common to all applications in the domain, or to an important subset of such
applications? If a working generator has already been built, it may be easier to spot
these parts by comparing several generated applications. You can also look at the
generator itself, in particular for any pieces of boilerplate code longer than a line or
two, and which are generated only once or a fewtimes for each application.
Pages:
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610