Book a Demo

Author Topic: Custom constraint in profile: extension of Constraint or of Class?  (Read 3465 times)

Jacob Vos

  • EA User
  • **
  • Posts: 108
  • Karma: +0/-0
    • View Profile
I tested two ways to define a custom (own stereotyped) constraint in a profile: as extension of Constraint and as extension of Class. I prefer the last one, but am interested to hear others' opinions.

Reasons why I prefer custom constraints as extension of Class:
1. The constraints are shown in the project browser.
2. Autocounter / naming can be applied.
3. In a relationship matrix, the constraints can be set as as context item (with the build-in Constraint metaclass, there is a bug with this).
4. I prefer the properties window that is opened above the one for the build-in Constraint metaclass.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Custom constraint in profile: extension of Constraint or of Class?
« Reply #1 on: April 04, 2020, 01:28:43 am »
As per UML spec a constraint is a PackageableElement which itself is a NamedElement. A Class is several stages more "complicated" (in inheritances). However, I think that your reasons are good enough to go for the Class. Basically when looking at the meta types it's the basic thing you would add to your profile to express "this is one of my business objects".

q.