Book a Demo

Author Topic: Association Roles vs Attribute Name  (Read 11030 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Association Roles vs Attribute Name
« on: May 29, 2006, 02:32:01 am »
It seems to me that there is some functionality missing from EA regarding the mapping of Association Roles to Attributes and vice versa.

In another post, I've noted a BUG wherein the Features are not spell checked.  Consequently, even if the Association Role was originally synchronised with the Attribute, it can get out of synchronisation due to this bug.

However, when I tried to get around the problem by resetting the Attribute name manually, the "linked" Target Role did not change!

How do I know it's linked?  Well, EA provided me with a drop-down for this purpose.

Now, I know I can override this name with my own, but if I don't, aren't I implicitly requesting the link?

What EA didn't do was to formalise that linkage.

UML specifically states that a named, navigable, Association role IS an Attribute.  So, notwithstanding that EA doesn't directly implement this, it should still maintain the name linkage.

Thoughts?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #1 on: May 29, 2006, 03:57:10 am »
No thoughts, other than I agree with what you are saying.

About a year ago I was working through an implementation of the CWM. We were being faithful to the OMG reference model, which relies heavily on the linkage between roles and attributes.

What I can say is that having the explicit linkage, and having it remain in synch, would be a life saver when working with metamodels. It would have saved me numerous hours, the building of at least one add-in (that did not otherwise need to be there), and considerable angst about whether I'd caught all typos and changes.

David
No, you can't have it!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #2 on: May 29, 2006, 08:06:17 pm »
[glb]WARNING WARNING WARNING - Will Robinson![/glb]

I've just discovered that you can have multiple Associations mapping to the SAME Attribute!

This surely is WRONG?

Needs to be fixed!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #3 on: May 29, 2006, 09:01:03 pm »
Interesting - I dont think this is wrong.  Consider a type heirarchy - you may want to model the association at various  levels of the heirarchy for some arcane purpose.

b
"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.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #4 on: May 29, 2006, 10:08:34 pm »
Quote
Interesting - I don't think this is wrong.  Consider a type hierarchy - you may want to model the association at various  levels of the hierarchy for some arcane purpose.

b
I do that by creating derived Associations (again, not directly supported by EA).  The attributes are therefore also derived.

However, that isn't the case here.  They are to different Classes altogether.
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

sl@sh

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #5 on: August 10, 2007, 05:13:22 am »
I just hit exactly the problem Paolo described initially in this thread.

To put it short: I can edit both the target role of my association and the name of the attribute the association is linked to (via it's target role) - but the changes are not reflected in the linked property! In other words, although the association is explicitely linked to an attribute, EA completely disregards this link wrt manual changes!

Still using EA 6.5 build 803.

Has this been fixed in a newer build?

edcwhite

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #6 on: September 07, 2007, 02:43:08 am »
Quote
I can edit both the target role of my association and the name of the attribute the association is linked to (via it's target role) - but the changes are not reflected in the linked propertyStill using EA 6.5 build 803. Has this been fixed in a newer build?


I am using the latest build (7.0 build 816) and this is still an issue.   I ran into this problem yesterday and am still trying to find a workable solution..  This is going to cause us a lot of grief until it is fixed.

thomas.kilian

  • Guest
Re: Association Roles vs Attribute Name
« Reply #7 on: April 17, 2008, 10:19:39 pm »
I meanwhile reached the surface to look over this. I have a quite simple problem here. Why should one declare an Attribute AND create an Association named with that Attribute? Isn't it that naming the end role of an association makes this an attribute per se? If so (and it seems logical to me) then why am I offered attribute names in the end role drop down? What would be the reason to do that?

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #8 on: April 18, 2008, 02:06:04 pm »
Quote
I meanwhile reached the surface to look over this. I have a quite simple problem here. Why should one declare an Attribute AND create an Association named with that Attribute? Isn't it that naming the end role of an association makes this an attribute per se? If so (and it seems logical to me) then why am I offered attribute names in the end role drop down? What would be the reason to do that?
Yes you are correct.

Since the original posting, I've come to the view that we need to see the attribute and the association as two renderings of the same "fact".  Consequently, the user should be able to decide (on an attribute specific basis) whether to show the attribute, the association or both.  Changing one should change the other!

Paolo
« Last Edit: April 18, 2008, 02:06:33 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

thomas.kilian

  • Guest
Re: Association Roles vs Attribute Name
« Reply #9 on: April 18, 2008, 06:04:06 pm »
Good to hear that from you. That gives it an extra weight :)

So it's sort of: Create an attribute of type SomeClass and if SomeClass appears on the diagram as well then render an association (automatically) or tell EA to do so via some switch. And vice versa if one creates an association then there should appear an according attribute.

Currently I'm doing quite a lot XSD/UML mapping. The only thing I'm missing is some sort of anonymous attribute (where XSD uses a "ref="). As a work around I name the attributes and roles as "(num)" where num is a unique counter in the schema and add a tag anonymousRole.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #10 on: April 20, 2008, 10:01:27 pm »
IMHO you are seeing yet another aspect of the same root problem. I like the solution Paolo proposes. [Which is itself another projection of the same issue of course.]

Sparx would reap huge benefits in extended server life as the number of posts relating to attributes and roles dropped off.

David
No, you can't have it!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13495
  • Karma: +572/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Association Roles vs Attribute Name
« Reply #11 on: April 28, 2008, 05:46:07 pm »
IMHO this should not be a problem. By defining both an attribute and an association your documenting a feature of your system redundant. Offcourse we all know that we should avoid redundancy.
I see this as a difference between two levels of models.
If I'm defining an abstract PIM like UML model I use associations, and not attributes.
If I'm defining a UML representation of programming code (PSM like Model) then I use attributes and no associations.

So no redundancies, and no issues in keeping them in sync.

thomas.kilian

  • Guest
Re: Association Roles vs Attribute Name
« Reply #12 on: April 28, 2008, 06:04:08 pm »
But associations give you a clearer picture of how classes relate to each other. Taking them out in PSM would not be of much help, I think.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +257/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Association Roles vs Attribute Name
« Reply #13 on: May 05, 2008, 05:37:18 pm »
Quote
But associations give you a clearer picture of how classes relate to each other. Taking them out in PSM would not be of much help, I think.
I agree...

IF they were just two renderings of the same fact, you could render them at will... [  ] Show Attributes only,  [  ] Show Associations only,  [  ] Show both Attributes and Associations

It could get more flexible than that - but that would be a start...
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

thomas.kilian

  • Guest
Re: Association Roles vs Attribute Name
« Reply #14 on: May 05, 2008, 05:47:42 pm »
How long have we been waiting for one of these starts? In the very beginning there was that joint action with Marcello (lost in Chile) where a lot of the legwork was already done but in the end nothing really happened. Sparx seems to be more focused on putting on a new wax coating rather than tuning the motor.