A framework is provided for generating code for the model-based
development of a system. According to the framework, the model-based
system is modeled using graphical modeling entities. A modular code
generator routine is attached directly to at least one of the graphical
modeling entities or to a meta-entity or to a collection of entities. The
graphical modeling entities are traversed in order to access specified
code generator routines. Each of the accessed code generator routines is
executed so as to build up code portion by portion for the system.