Book a Demo

Author Topic: Valid Values for an Attribute...  (Read 5847 times)

AndyJ

  • EA User
  • **
  • Posts: 337
  • Karma: +5/-3
  • It's only a model
    • View Profile
Valid Values for an Attribute...
« on: June 08, 2010, 01:30:25 pm »
Hi people,

I must be missing the obvious here...

I have a class that contains a number of attributes.

Two of the attributes can only contain a very limited set of valid values. Lets call them Source Reliability and Information Reliability.

In this case I'd expect to be able to record:

Source Reliability
{char 1}
{initial value: F}
{valid values: A B C D E F}

Information Reliability
{char 1}
{initial value: 6}
{valid values: 1 2 3 4 5 6}

But so far have not been able to find somewhere to record this information against an attribute in a class.

I can see type and initial value, but cannot find a location for valid values...

Is it necessary to create a tagged value for each attribute where I wish to record this kind of information or am I missing an obvious dialog somewhere?
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."

AndyJ

  • EA User
  • **
  • Posts: 337
  • Karma: +5/-3
  • It's only a model
    • View Profile
Re: Valid Values for an Attribute...
« Reply #1 on: June 08, 2010, 02:16:16 pm »
Digging further, I've found an attribute in the EA example project:

Rent:RentPerDay which contains a constraint:
AllowableValues{80,150,100}

However, even if I use that method, I haven't been able to find a way to make that (embedded) constraint visible to someone working with the model...
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Valid Values for an Attribute...
« Reply #2 on: June 08, 2010, 03:38:24 pm »
Andy,

What you are describing are enumerations.
Search the help file for enumeration.

Geert

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Valid Values for an Attribute...
« Reply #3 on: June 08, 2010, 08:16:17 pm »
AndyJ,

If the "someones" working with the model can't or won't read a constraint then I can lend you a (reasonably) blunt bread-knife (or a chainsaw) that you could use to convince them that there is a wealth of information beyond the pretty pictures ... and they'd better dam'n well read 'em.

yours in the hope of a better future for all of that do describe constraints
bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

AndyJ

  • EA User
  • **
  • Posts: 337
  • Karma: +5/-3
  • It's only a model
    • View Profile
Re: Valid Values for an Attribute...
« Reply #4 on: June 09, 2010, 09:42:33 am »
While I share your pain, it may be one of those theory vs. practice problems.

Developers are often under a lot of pressure, and it may be unreasonable to expect them to drill down to lower levels of a model to check for the existence of things, that 99.9999% of the time do not exist.

For this reason, I usually "externalise" constraints so that they appear on the class diagram, even if it is exported as a "pretty picture".

This also makes it easier to keep the users in the loop...

 ;)
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Valid Values for an Attribute...
« Reply #5 on: June 09, 2010, 09:57:16 am »
If you put the constraint on the class rather than the attribute, the constraint can be shown on the diagram.

Alternatively, you can give the developers the documentation not the model - then the attribute level constraints won't be out of sight.
The Sparx Team
[email protected]

AndyJ

  • EA User
  • **
  • Posts: 337
  • Karma: +5/-3
  • It's only a model
    • View Profile
Re: Valid Values for an Attribute...
« Reply #6 on: June 10, 2010, 01:17:42 pm »
OK. If I am reading correctly... This is the UML way of describing the limited list of values for these two attributes.



Can anyone confirm this?
« Last Edit: June 10, 2010, 01:20:16 pm by novaphile »
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Valid Values for an Attribute...
« Reply #7 on: June 10, 2010, 02:39:09 pm »
Andy,

The attributes type's should not be char(1), but "Source Reliability" or "Information reliability".
The associations are not necessary.
(you can draw a dependency if you want to graphically show the relation)

Geert

AndyJ

  • EA User
  • **
  • Posts: 337
  • Karma: +5/-3
  • It's only a model
    • View Profile
Re: Valid Values for an Attribute...
« Reply #8 on: June 10, 2010, 02:55:01 pm »
OK.

Like this?



Thanks Geert,

Much appreciated.

Andy.
Sun Tzu: "If you sit by the river long enough, eventually the body of MS Visio floats past."

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Valid Values for an Attribute...
« Reply #9 on: June 10, 2010, 04:36:52 pm »
Yep, like that.

Geert