Book a Demo

Author Topic: Use Association Class for two Associations  (Read 3262 times)

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Use Association Class for two Associations
« on: July 26, 2005, 08:40:11 am »
Hi all,

I have Three classes (A, B and C). There is a association between A and B and between C and B. And there is a class D which is an association class for the association between A and B.

Now I want to use the same class for an association class between C and B. The problem is: EA did not allow, to connect a class to two associations.

Is this a missing feature of EA or is it not allowed by UML?

bye
Andreas
bye
Andreas

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Use Association Class for two Associations
« Reply #1 on: July 26, 2005, 03:57:30 pm »
Quote
Is this a missing feature of EA or is it not allowed by UML?


The latter. AssociationClass inherits from Association and Class. "Inherits from" is an "IS A" relationship not a "HAS A" relationship, so your association class IS the association between A and B and cannot be the association from B to C as well.

HTH,

Neil
The Sparx Team
[email protected]

Andreas_G

  • EA User
  • **
  • Posts: 125
  • Karma: +0/-0
  • And that's the way the cookie crumbles.
    • View Profile
Re: Use Association Class for two Associations
« Reply #2 on: July 26, 2005, 11:59:15 pm »
Hi Neil,

thanks for your answer. What you said sounds logical to me and helps me to understand the meaning of an association class. And it's clear to me now that I need two classes.

But this creats an other question in my brain:
As I understand, whit an association class I create (something like) a new kind of association. Is this correct?
If it's so, and I want to use this new type of association twice in my model. How can I do it?

bye
Andreas
bye
Andreas

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Use Association Class for two Associations
« Reply #3 on: July 27, 2005, 01:22:40 am »
Quote
[size=13][SNIP][/size]
But this creates an other question in my brain:
As I understand, whit an association class I create (something like) a new kind of association. Is this correct?
If it's so, and I want to use this new type of association twice in my model. How can I do it?

bye
Andreas
Andreas,
you might find N-
Ary Associations and Association Class
useful as a way of understanding AssociationClasses.

However, to your point about re-use.  What you may be seeing is that you wish to use the same form of AssociationClass (that is, the same set of attributes) between multiple Classes, but each will have its own instance.

In my Conceptual Metamodel, which I am creating using an XSD for export of Metadata from an EA model, I make AssociationClasses look like ordinary classes, but with the additional "link" attributes, that link the Association Class to its AssociationEnds.  That is, I specifically identify those attributes that are the AssociationEnds from those that are other (normal) Associations to the AssociationClass.  These attributes are always mandatory, singular.

I haven't got as far as emitting the AssociationClass yet, but the bench-testing I've done seems to suggest it will work.  Also, this view allows for N-Ary Associations to be represented in this way.

HTH,
Paolo
« Last Edit: July 27, 2005, 01:23:31 am by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!