Hello,
acually, I want to compare two Rhapsody elements using the Java Api, like if two ports use the same interface contracts. The same means that they really use the same Rhapsody element. Indeed it might be that due to different versions, the Interface definitions even might differ ins some aspects, but this is not to be taken into account (yet).
Currently I see two possibilities:
- use the Java equals method i.e.
contract 1.equals(contract2)
- take some string elements (like path name, GUID ...) and compare them like
contract1.getFullPathName().compareTo(contract2.getFullPathName()) == 0
Actually, I'm not shure what IBM does? Did they override the equals and implement some meaningful comparison, so that equals is safe?
Should I implement own comparators?
What is the preferred way to compare two Rhapsody objects for equality?
Best regards
Robert
------------------------------
Robert Fromm
------------------------------