Chapter 3. Design Considerations

Table of Contents

Does generating Code make Sense?
Good and Bad Code Generation
Generic vs. Generative Solutions
UML Profile Design
Forward Engineering & the Development Process
Embedding Code Generation in your Development Cycle
Generating Code in regular automated Builds

Does generating Code make Sense?

As with any tool, code generation and MDA is not a silver bullet. The key to successfully applying it to your project is to decide when this makes sense, and when it doesn't.

The following list includes the main indicators that your project might benefit from using a generative approach:

  • You have few business model elements, such as entities and processes, but a complicated infrastructure

  • You are using a technology that requires you to specify information in multiple places, yet maintain consistency (such as J2EE)

  • There is a need to isolate technical changes from changes in business requirements

There are also some indicators that a generative approach might not be the best tool for the job:

  • The project's focus is largely on algorithms, not largely static structure

  • You are building a low-level component, such as an I/O library

  • Your project is trivial and small

As with any recommendation, these guidelines are not intended to be applied without careful consideration. In general, most developers start building a prototype, and while doing so, recognize repetitive elements. This is generally the best way to find out whether you should use a generative approach in your project.