I am wrestling with an EA issue. Here's what I sent to EA last week (and have not heard back other than an acknowledgement of receipt). Can anyone shed some light on this?
Subject: Association Class Vanishes
Details:
The bug occurs when an association is in a different package than the class that will be made the association class and both are under source code control. If the package containing the association is not checked out and the package containing the class to be made the association class is checked out, EA will allow the class to be made an association class. However, as soon as the class containing the association is checked out, the association class link vanishes.
Steps to Reproduce:
Create a package A with classes X and Y and an association A between them. Check it into source code control. Now create a second package B with class Z. Add a class diagram to B showing classes X, Y, and Z. Right mouse on Z and make it an association class for association A. Now check package B into source code control. Finally, check package A out from source control. The association link vanishes on the class diagram in package B. Z still thinks it is an association class (you can right mouse and un-link Z and the association).
After more experimentation I sent this follow-on:
This is a more serious problem than I thought. If the package containing the class that is the source of the association is different than the package containing the association class and both are under source code control then checking out the package containing the class owning the association will ALWAYS corrupt the link between the association class and the association. There does not appear to be any workaround other than co-locating the two in the same package, which in many cases is not the appropriate way to organize the model.
And a third update:
Some more information. I modified the model to put both the association source class X and the association class Z in package A. The association target class Y is in package B. Establish Z as the association class for an association between X and Y and check everything in. Now check out package A and then check out package B. When package B finishes checking out, the link between Z and the association disappears, but Z still thinks it is an association class.
***************************************
Sparx claimed that the problem is covered by their best practices document:
So the recommended practice would be :
- Check out Package A and Package B while modeling.
- Once the you've done, then Check-in Package A and Package B ( now both the packages are in Sync)
- then you don't see this issue while checking out the 'Package A'.
We have a white paper explaining about this scenarios. Please see topic 'Recommended processes for submitting changes safely' on page 10.
https://www.sparxsystems.com/WhitePapers/Version_Control.pdfHowever, even following their best practices there is a problem with association classes. The simplest example is:
- Create packages A and B, put them both under source control and check both out
- In package A create classes X and Y and an association A between them.
- In package B create class Z and make it an association class of association A.
- Using check in branch, check in both packages A and B.
- Check out package B - everything is OK
- Check out package A - the link between Z and association A indicating the association class is gone. An integrity check shows an invalid association class.