Author Topic: Synchronise Class Attributes and Associations  (Read 4195 times)

Sean Kearon

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Synchronise Class Attributes and Associations
« on: June 29, 2005, 07:07:32 am »
Our convention is to use attributes only to model primitive types (string, int, etc.) and associations only to model links to other types, including enumerations in the model.  This works well for us and reduces clutter in the model by not representing the same information twice.  (I'd be interested to hear if anyone else does this, but that's not my point!)

Alternatively, you can model a link to another non-primitive type as an attribute and use the attribute detail tab to declare the multiplicity of the 'link'.  If I have such an attribute, I get to select it in the role name if I then choose to go and add an association.  However, I can set the multiplicity of the role end of the association to a different value from the attribute, and visa versa.  Would these not be better synchronised?

Also, again in the case where I have a 'link' attribute, but have no additional association to represent this, the 'relationship' between the types does not appear in the Relationships window.  I think it should as the attribute represents a link between two classes.

I think that both of these should be added as features.  The synchronisation should also be mandatory as the model is inconsistent if there are two representations of the same 'link' that show different values.

Sean

Sean Kearon

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Synchronise Class Attributes and Associations
« Reply #1 on: June 29, 2005, 07:30:12 am »
To take this further, what I think I should be able to do is select how I want to represent this 'link' between the classes, similarly to what VS2005 allows you to do this in its class designer.  An association and an attribute whose type are conceptually the same thing and should be treated as such.  

This could be implemented in a number of ways - diagram or model level preference (as link, as attribute, as both), or by right-clicking the item and selecting.

Gee, that would make me happy.  ;)

Sean

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8607
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Synchronise Class Attributes and Associations
« Reply #2 on: June 29, 2005, 10:27:23 am »
You will find supporting discussion in:
http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=UMLPRO;action=display;num=1118286766
Cheerz,
Paolo
BTW: submit a formal suggestion to the support email address...
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Sean Kearon

  • EA User
  • **
  • Posts: 126
  • Karma: +0/-0
    • View Profile
Re: Synchronise Class Attributes and Associations
« Reply #3 on: July 01, 2005, 06:41:27 am »
Thanks for the link Paolo.  I will submit a formal to Sparx.

Cheers

Sean