Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: MatthiasVDE on February 29, 2016, 07:19:41 pm

Title: EA12 - Extra attributes types
Post by: MatthiasVDE on February 29, 2016, 07:19:41 pm
Is it possible to add extra attributes types in a class diagram. For example, string, enum, ...
Title: Re: EA12 - Extra attributes types
Post by: qwerty on February 29, 2016, 08:41:31 pm
You can assign an attribute any type you want.

q.
Title: Re: EA12 - Extra attributes types
Post by: MatthiasVDE on February 29, 2016, 09:30:48 pm
I know, but can I save them so they are reusable?
Title: Re: EA12 - Extra attributes types
Post by: qwerty on February 29, 2016, 10:17:48 pm
I remember that you can define your own language and introduce datatypes for that. I haven't used that for years...

q.

P.S. See Project/SettingsCode Engineering Datatypes... Add your new language and define some types. Then create a class and make it this new language (Apply change). Then when you edit attributes you see the datatypes you defined.
Title: Re: EA12 - Extra attributes types
Post by: Uffe on February 29, 2016, 10:34:46 pm
Hi Matthias, and welcome to the forum! :)

Attributes are not quite as simple as they might first appear. There are three ways to set an attribute type.


In order to modify the set of attribute types for a language, go to Project -- Settings -- Code Engineering Datatypes. If you want to define your own language, click "Add Product". Note that unless you define at least one attribute type, EA will delete the language / product when you close the dialog.

The same set of languages in a project is the basis for EA's code generation (there is a set of code generation templates for each language), but you don't need to go into that just to create your own set of attribute types.

HTH,


/Uffe
Title: Re: EA12 - Extra attributes types
Post by: Uffe on February 29, 2016, 10:35:44 pm
In other words, what q said.  ;D
Title: Re: EA12 - Extra attributes types
Post by: MatthiasVDE on February 29, 2016, 11:46:19 pm
I just added them to the Java language and it works fine, thanks!