Book a Demo

Author Topic: EA12 - Extra attributes types  (Read 6299 times)

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
EA12 - Extra attributes types
« on: February 29, 2016, 07:19:41 pm »
Is it possible to add extra attributes types in a class diagram. For example, string, enum, ...

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA12 - Extra attributes types
« Reply #1 on: February 29, 2016, 08:41:31 pm »
You can assign an attribute any type you want.

q.

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
Re: EA12 - Extra attributes types
« Reply #2 on: February 29, 2016, 09:30:48 pm »
I know, but can I save them so they are reusable?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: EA12 - Extra attributes types
« Reply #3 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.
« Last Edit: February 29, 2016, 10:21:46 pm by qwerty »

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: EA12 - Extra attributes types
« Reply #4 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.

  • Free text: enter whatever type name you want. Not reusable.
  • Specify classifier: use the ellipsis button ("...") to pick a class. EA sets the type name, and if you then change the name of the class, the type name is automatically updated.
  • Pick from the drop-down list. The contents of this list is defined by the Language property of the class (C, Java, etc) and are thus reusable.

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
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: EA12 - Extra attributes types
« Reply #5 on: February 29, 2016, 10:35:44 pm »
In other words, what q said.  ;D
My theories are always correct, just apply them to the right reality.

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
Re: EA12 - Extra attributes types
« Reply #6 on: February 29, 2016, 11:46:19 pm »
I just added them to the Java language and it works fine, thanks!