Book a Demo

Author Topic: Show constraint for attribute?  (Read 4359 times)

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Show constraint for attribute?
« on: January 28, 2009, 10:55:35 am »
I can create attributes for a class or for attributes in that class.  I see how to change the diagram properties to show the constraints for a class, but I haven't been able to get the diagram to show the constraints for an attribute (which would be quite helpful).  Is it possible to do this?

Paul

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Show constraint for attribute?
« Reply #1 on: January 28, 2009, 11:05:42 am »
I think the best you can do is attach an element note. In the EA help index look up Note | Element. [Specifically, not Note | Element, Create.]

Not perfect, and fairly high maintenance if your project is changing a lot, but it can work well if you don't have too many constraints.

David
No, you can't have it!

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: Show constraint for attribute?
« Reply #2 on: January 28, 2009, 11:14:28 am »
Thanks!  I want to show constraints for an attribute (e.g., 0 <= seconds < 60).  I can create such a constraint but I guess there just isn't a way to show that in the current release of EA.  I can create a new element (Seconds), assign it the same constraint, and make the element constraints viewable.  Then I can associate the element with the class for which it is a parameter (e.g., Time).  This works and is logically consistent but it takes up more diagram space.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Show constraint for attribute?
« Reply #3 on: January 28, 2009, 10:24:07 pm »
You could also just create a 'constraint' type of note and type in the constraint text. This is a patchwork solution though. The note in this case is not really attached to the constrained item (the attribute). It actually duplicates (rather than references) the content of the 'real' constraint. This could be a maintenance issue later on. Still, it works for diagrams...
No, you can't have it!

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: Show constraint for attribute?
« Reply #4 on: January 29, 2009, 03:27:58 am »
David, that is another solution, to be sure.  For the moment I am using element-level constraints.  This puts some limitations on how I make the diagrams, but at least for my purposes it seems to be a good solution.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Show constraint for attribute?
« Reply #5 on: January 29, 2009, 05:25:33 am »
You can link notes to element (versus attribute) 'features' including constraints. That's what I was thinking of the first time, but the terminology seems to be specific to EA.

In the EA help file look up Note | Link to Element Feature.
No, you can't have it!

Paul Lotz

  • EA User
  • **
  • Posts: 248
  • Karma: +1/-0
    • View Profile
Re: Show constraint for attribute?
« Reply #6 on: January 29, 2009, 05:39:21 am »
OK, but I can create constraints for an element and show them in the diagram by showing the constraints compartment.  Then it just depends on whether you want to see them in a note or a compartment of the element.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Show constraint for attribute?
« Reply #7 on: January 29, 2009, 07:47:35 am »
You are quite correct. It is really a question of what you want to highlight and how. Would that there were more options, or at least some additional flexibility, but the current situation is not too bad.

Consider what your audience needs to see, and the best way to get the message across. Then choose a method.

You are still left with the question of how to (automatically) do this for attribute constraints...
No, you can't have it!