Book a Demo

Author Topic: Unexpected Attribute/AssociationEnd mismatch  (Read 3674 times)

srodrigue

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Unexpected Attribute/AssociationEnd mismatch
« on: March 31, 2007, 03:11:42 pm »
Hello,

 I have a trouble with class model validation. The problem is when there is an aggregate association corresponding to an atribute that instead of being a dumb pointer (MyClass*) is a smart pointer (boost::shared_ptr<MyClass>. I tried to use the "member type" field in the association configuration and that made it work well for code synchronization, but not for validation. I always get warning messages when doing model validation which looks like that :

MVR090001 - warning (PerfMon (Class)): Attribute/AssociationEnd mismatch, myRecordIndexLookup: Type (boost::shared_ptr<RecordIndexPtr>/RecordIndexLookup)

Is there a way of configuring things so I don't get warning messages in that situation ?

Thank you in advance.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Unexpected Attribute/AssociationEnd mismatch
« Reply #1 on: April 01, 2007, 12:34:19 pm »
There has been a great deal of discussion in the forum about the way EA handles aggregations (or similar connectors).

Please search for Aggregation in the title of threads for a good sampling. You'll quickly find some guidelines for making EA recognize aggregations correctly. Depending on how you set your connectors up this might not happen.

Unfortunately there does not seem to be an easy way to convert existing models, at least not from within EA. If you have a lot of models that need updating a quick add-in or some SQL on the model file would seem to be your best options.

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Unexpected Attribute/AssociationEnd mismatch
« Reply #2 on: April 01, 2007, 01:34:19 pm »
It isn't an aggregation problem, it's a validation problem. EA's validation doesn't see "boost::shared_ptr<RecordIndexPtr>" and "RecordIndexLookup" as being the same thing. There are a number of things you can do here: 1. Remove either the attribute or the association from your model - they both represent the same thing, so one is redundant; 2. Ignore the warning message; 3. Switch off the validation rule that causes the warning, I think it's "Feature: Property Validity"; 4. Send in XMI export of the two classes involved to Sparx Support and we will see how/if the rule can be changed to recognize "boost::shared_ptr<RecordIndexPtr>" and "RecordIndexLookup" as being the same thing.
The Sparx Team
[email protected]

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Unexpected Attribute/AssociationEnd mismatch
« Reply #3 on: April 01, 2007, 02:04:41 pm »
Thanks Neil, that's a lot 'cleaner' than I feared it would be.
No, you can't have it!

srodrigue

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Unexpected Attribute/AssociationEnd mismatch
« Reply #4 on: April 02, 2007, 02:38:48 am »
I like the solution #1 of removing the attribute which is redundant because there is the association. The problem is when I synchronize the model with the code, the attribute is added to the code from the association, which is correct. Then, when I do a reverse-synch, the attribute is then added back to the model and the validation problem arise. So finally I did solution #3, just switch off the validation rule.

Thank you very much for your help guys.

slbrook

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
  • Today is a gift. Have fun!
    • View Profile
Re: Unexpected Attribute/AssociationEnd mismatch
« Reply #5 on: September 18, 2007, 10:59:24 am »
I am also getting this warning message and am not sure how to handle it. MVR090001 Attribute/AssociationEnd mismatch.
I am not sure what this means or how to correct it.
Thanks,
Scott