7

In Enterprise Architect when I model a class and specify the implementation language of the class, then use an instance of the class in a use case, the implementation language of the instance in the use case is not the implementation language of the class, but is the default. Is there a way to make Enterprise Architect use the set implementation language of the class for the implementation language of all instances of that class?

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
KSletmoe
  • 977
  • 9
  • 23
  • Of course, code generation doesn't work on instances, so an instance doesn't really need a code generation language. – chimp Jul 17 '12 at 00:01
  • 1
    Right, I agree in most cases. Every once and a while though it could be nice to be able to tell what the implementation language of an object is (like in a project that encompasses several pieces written in different languages, and you are sorting through use cases) – KSletmoe Jul 20 '12 at 21:27

3 Answers3

22

There isn't an option to make instances follow the class language (but that's a good suggestion to send to Sparx), but you can set the default language for all new elements. From your question, I take it you already know how but I'll include it for other readers.

Tools - Options - Source Code Engineering - Default Language for Code Generation is the one you're after. This option is somewhat incorrectly named; it actually sets the default language for created elements.

As long as you're modelling things for one implementation language at a time this works very well. If you're modelling for different languages and realize that you've got the wrong one in a large part of your model, you can right-click the package in the project browser and select "Code Engineering - Reset Options for this Package."

Select "Where language is" - Any, and "Convert to" the language you want. Make sure to tick "Process Child Packages."

Uffe
  • 10,396
  • 1
  • 33
  • 40
10

In Enterprise Architect 12.1 I found it here:

PROJECT - Settings - Project Options - Source Code Engineering - Default Language for Code Generation

Stefan Ott
  • 109
  • 1
  • 3
2

In Enterprise Architect 13.0 I found it here:

Start - Window - Show Toolbar - Code Engineering

In toolbar its first option. Second is default database. Database option is also in:

Start - Workspace - Preferences - Source Code Engineering - Code Editors

but there is not programming language.

Tomas Kosar
  • 394
  • 1
  • 10
  • 23