Author Topic: Associated class traceability  (Read 1234 times)

AlexY

  • EA User
  • **
  • Posts: 60
  • Karma: +1/-0
    • View Profile
Associated class traceability
« on: September 25, 2011, 07:12:49 am »
Hello All,

Background:
When I browse the model created with the class digram below

with traceability browser, I do not see any links b/w ClassC and the rest of the elements in the model (ClassA and ClassB)

nor I am able to find any link between ClassC and the connector connecting ClassA and ClassB.

Questions:
(1) Is there a way to trace from the classes A & B to class C (Associated Class) through the model in EA?
(2) Is such traceability b/w a Class and an Associated Class supported in UML at all?

Thanks,
Alex.
« Last Edit: September 26, 2011, 12:33:05 am by alex.yakovlev »

AlexY

  • EA User
  • **
  • Posts: 60
  • Karma: +1/-0
    • View Profile
Re: Associated class traceability
« Reply #1 on: September 25, 2011, 07:41:08 pm »
Based on discussion of Association Class I came to conclusion that implementation of Associated Class in SparxEA is not correct.

SparxEA implements Associated Class as follows:
ClassA<-------->ClassB with ClassC being an orphan.

In the correct implementation, ClassA should not link to ClassB directly in the model. The ClassA and ClassB are supposed to be linked through ClassC with constraint that there is at most one instance of ClassC for every pair of ClassA and ClassB:
             1       1-n              0-n      0-1
ClassA <----------> ClassC <----------> ClassB

Question to UML experts:
Do you agree with my conclusion?
« Last Edit: September 25, 2011, 07:44:02 pm by alex.yakovlev »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2498
  • Karma: +32/-2
    • View Profile
Re: Associated class traceability
« Reply #2 on: September 26, 2011, 10:17:12 am »
Disagree. You have shown a valid alternative approach to modelling the same information, but the two constructs are not the same thing and it would be wrong for EA to assume one from the other.

However, you have highlighted the fact that it isn't always possible via the GUI (or if it is possible I can't find it) to select the class part of an association class and find its association or the two classes at the association ends. You can press Ctrl+U, but that requires they are all on a diagram together (moral of the story: make sure they are always on a diagram together somewhere in the model).
The Sparx Team
support@sparxsystems.com

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 8204
  • Karma: +193/-23
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Associated class traceability
« Reply #3 on: September 27, 2011, 11:17:57 pm »
I agree with KP.
What you have shown is probably how an association class is implemented in code or databases, but it is not the same thing.

Geert


AlexY

  • EA User
  • **
  • Posts: 60
  • Karma: +1/-0
    • View Profile
Re: Associated class traceability
« Reply #4 on: October 02, 2011, 10:10:35 am »
KP/Geert,

Thanks for your responses.

Quote
you have highlighted the fact that it isn't always possible via the GUI (or if it is possible I can't find it) to select the class part of an association class and find its association or the two classes at the association ends.
KP, do you suggest that it is possible to trace from ClassA to ClassC not though GUI but through the model? If yes, then this is exactly what I am looking for. Would you please explain the way if there is one?

Quote
What you have shown is probably how an association class is implemented in code or databases, but it is not the same thing.
Geert, so if what I have shown is possible implementation of association class in a code/database. How can I generate such implementation from the class model I presented, if there is no way to trace from ClassA to ClassC through the model? or there is? How? - this is exactly what I want to know..

Thank you for your help..

Alex.
« Last Edit: October 02, 2011, 10:12:32 am by alex.yakovlev »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2498
  • Karma: +32/-2
    • View Profile
Re: Associated class traceability
« Reply #5 on: October 03, 2011, 09:11:26 am »
Quote
KP, do you suggest that it is possible to trace from ClassA to ClassC not though GUI but through the model? If yes, then this is exactly what I am looking for. Would you please explain the way if there is one?
In either an add-in or a script, you would need to get the association and check its MiscData(0) value - it will hold the ID of the class part. If SQL is your weapon of choice, its the t_connector.PDATA1 field.
The Sparx Team
support@sparxsystems.com