Author Topic: Displaying attribute-level constraints  (Read 6236 times)

bernardm

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Displaying attribute-level constraints
« on: January 10, 2013, 10:35:10 pm »
Hi,

In a class diagram, is there a way to display attribute-level constraints in the attribute compartment?

Thanks for your help!

Bernard

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Displaying attribute-level constraints
« Reply #1 on: January 11, 2013, 03:23:24 am »
You can create Constraint elements and link these to the class and further via Link to Element Feature/Attribute. But you can't use the constraints defined in the attributes section.

q.
« Last Edit: January 11, 2013, 03:25:23 am by qwerty »

bernardm

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Displaying attribute-level constraints
« Reply #2 on: January 14, 2013, 06:50:23 pm »
Thanks for the tip.
Have a good day,
Bernard

Takeshi K

  • EA User
  • **
  • Posts: 592
  • Karma: +39/-1
    • View Profile
Re: Displaying attribute-level constraints
« Reply #3 on: January 18, 2013, 01:21:57 pm »
If an attribute has a tagged value 'xUML', its value will be shown in the attribute compartment. Adding this value and enter a constraint will solve your problem.

HTH,
--
t-kouno

bernardm

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Displaying attribute-level constraints
« Reply #4 on: January 18, 2013, 07:41:25 pm »
Excellent! I'm just wondering where you catched this "hidden feature" from...  ;)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Displaying attribute-level constraints
« Reply #5 on: January 18, 2013, 07:54:07 pm »
He's a friendly Sparxian.

q.

philchudley

  • EA User
  • **
  • Posts: 743
  • Karma: +21/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Displaying attribute-level constraints
« Reply #6 on: January 18, 2013, 08:16:04 pm »
Cool!

I have been looking for a way to this for years and up to now have used the class constraints and showing the constraints compartment for the class.

Sparx certainly kept this well hidden! Makes you wonder how many other secrets there are  ;)

Cheers

Phil
Models are great!
Correct models are even greater!

bernardm

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Displaying attribute-level constraints
« Reply #7 on: January 18, 2013, 09:19:48 pm »
Yep, this is top notch!

By the way I've just introduced a new feature request to have attribute- level constraints shown natively in the attribute compartment.

In the meantime, xUML will be heavily used!

Takeshi K

  • EA User
  • **
  • Posts: 592
  • Karma: +39/-1
    • View Profile
Re: Displaying attribute-level constraints
« Reply #8 on: January 19, 2013, 01:09:04 pm »
The reason why I know this xUML tag is that I am the man who requested this feature in several years ago.

xUML means eXecutable UML, and this notation is used in some book about executable UML.


--
t-kouno

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
xUML also for operations
« Reply #9 on: January 21, 2013, 07:32:34 pm »
Hello,

nice feature. I could use it for #ifdef .... in C/C++ Code generation.

I would also like it for operations.

Kind regards,

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re:  xUML also for operations
« Reply #10 on: January 22, 2013, 06:55:23 am »
Quote
I would also like it for operations.
Yes! That would make sense.

I agree that #ifdef is a constraint, and should be modeled as such, but 'xUML' tag isn't really a constraint in the UML model, or maps to one, does it?
Or should we think of TVs as kind of 'specialized' constraints? Then 'xUML' is a pretty broad one IMHO.

So it's still all about visibility of the attributes'/operations' constraints, right?

1. Following the UML (2.3) specs a constraint should render within braces after the elements textual notation:
Quote
7.3.10 Constraint (from Kernel)
For an element whose notation is a text string (such as an attribute, etc.), the constraint string may follow the element text
string in braces
'xUML' unfortunately doesn't (you can use the braces explicitly though).

2. Before everyone starts to use 'xUML' as a surrogate for rendered constraints, it should be implemented as a native feature of EA (=> feature request) to select the constraints, that should be shown for an element feature (attribute,operation, maybe others ...) on a diagram (similar as with linked notes). This would keep UML constraints usable for other processes like transformations, code generation and model validation.

Just my 0.02 EUR,
Günther
« Last Edit: January 22, 2013, 08:42:17 am by g.makulik »
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Displaying attribute-level constraints
« Reply #11 on: January 22, 2013, 04:54:52 pm »
Hello Günther,

thanks for your valuable remarks.

In my opinion: xUML is a nice and low cost solution.

In long term I would prefer additional the UML solution mentioned by Günther.

In terms of diagram I think constraints of features are the right thing to visualize.

Kind regards,

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

bernardm

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Displaying attribute-level constraints
« Reply #12 on: January 22, 2013, 07:06:48 pm »
200% agree that xUml should be considered as a temporary work-around until Sparx provides a real uml-compliant solution.
Thanks guys for your supporting this.