Model elaboration is the idea that a model can be modified after it has been generated. Usually, this means adding code to the model, but it can also mean editing the generated model itself. This possibility of elaboration of target models is an advantage of the MDA framework because it allows developers to ease into model-driven development, rather than take a step function from a code-driven process to a model-driven one. To get the most out of model elaboration, it's important to follow certain principles:
If it's done carefully, then, elaborating models can be a perfectly acceptable practice in the context of MDA. When the target model is regenerated, one needs to be certain that this added code isn't replaced by the regenerated code. A simple approach is the concept of protected areas: If an area of the source model is protected, the mapping function can try to preserve the manually-entered contents. Detecting manual changes in target models, preserving/merging manual changes during mapping, and avoiding the loss of manually-created information are critical success factors in this area. The reverse engineering of models, and their bidirectional synchronization, is also of interest in this context. One-time usage of an abstracting mapping, which pulls the contents of a detailed model into a more abstract model for subsequent mapping to other more detailed models, can be very useful. We explore these topics further in Chapter 8. |