Fortunately, at
this level building a domain framework is similar to building any other kind of
components, so your existing experience will be valid and useful, as will any good
books on object-oriented programming.
If this is your ?¬?rst foray into DSM, you may well have found many other previous
beliefs about standards, modeling, and code generation being challenged. Hearing
that there is an area of DSM where things are pretty much ???business as usual??? will no
doubt come as something of a relief! Without wishing to disturb you from your
reverie, we do want to provide a few signposts to small ways in which the domain
framework and generated code may be a little different from what you are used to.
PROVIDING AN INTERFACE FOR THE GENERATOR 323
Generated Code Contains More Singleton Classes When you look at code
generated to run on a fair-sized domain framework, you may well notice a larger than
average number of singleton classes. They will be subclasses of a domain framework
class, often in quite a wide inheritance tree, and each may add only a small amount of
code. This may appear disconcerting: if you saw the same in handwritten code, you
would look suspiciously at it and try to apply various best practice strategies. What
could be moved up into the superclass to allowthat single class to be used for all of the
instances? Or which of the subclasses was really the same as another? Or perhaps the
subclasses could be arranged into a deeper hierarchy, with extra abstract classes
containing the features shared by several subclasses?
In fact, assuming the framework and generator have been made well, you are
actually seeing the end result of those very same strategies??”just applied far more than
normally happens with handwritten code.
Pages:
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605