How to Generate Code

Return to Introduction  Previous page  Next page

Before you generate code, you should ensure the default settings for code generation match your requirements. The default generation settings are located in the Source Code Engineering page of the Options dialog (access by selecting the Tools | Options menu option). Set up the defaults to match your required language and preferences. Languages such as Java support namespaces and can be configured to specify a namespace root.

Code is generated from Class or Interface model elements, so you must create the required class and interface elements to generate from. Add attributes (which become variables) and operations (which become methods). When you have completed the design of your classes, you can generate source code.

Before generating code, you should also familiarize yourself with the way Enterprise Architect handles local path names. Local path names enable you to substitute tags for directory names (eg. %SRC% = C:\Source).

Use Live Code Generation

On the Package Build Scripts dialog, you have the option to update your source code instantly as you make changes to your model.

See Also