Search code examples
c#code-generationenterprise-architect

Sparx Enterprise Architect (EA 14) Generating Code from class model for C# but it keeps defaulting to Java


I have been using Sparx EA for years. Mostly with Java, but a few years ago I used the round-trip feature for a C# project. It appears Sparx has changed the user interface and I cannot for the life of me find how to generate C# code. It keeps defaulting to Java.

I tried following their documentation but it may be a bit dated, as I didn't see the same options. So I poked around a bit. I found the Programming Languages Datatypes and selected C# for the product. That didn't work. I also tried Manage Project Options and set the Default Language for Code Generation to C# but that didn't work either.

What is the secret?


Solution

  • Set language in a single class

    In EA each class has a code generation language feature you can change.
    enter image description here

    Default Language setting

    You can set the default language using the option
    Configure | Model | Options | Source code Engineering enter image description here

    Change language in existing model

    In order to change the code generation for classes in an an existing model, use the option
    Develop | Preferences | Options | Reset Source Language enter image description here

    This answers has been written for the current version of EA (15.2). Menu locations might be different in v14, but the same options are available.