facebook

Removing and replacing class from model

  1. MyEclipse Archived
  2.  > 
  3. UML Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #239260 Reply

    My appologies if this is a dup. there are too many topics to search 🙁

    I found this problem while reverse engineering a class inheritance chain. I was pleased to find that the tool correctly identified and modeled generalization between classes and realization relationships between classes and interfaces. However, I found a bug when I (accidentally) undid (^z) a class import into the diagram. The removed class was in the middle of the hierarchy so generalization links between the parent and subclasses of the accidentally removed class were also removed from the diagram (as i would expect). However when i re-inserted the “middle” class, the links from the subclass to the newly inserted class were not redrawn. Examining the properties of the child class which previously shared a parent relationship with the removed / reinserted class showed the property was missing as well. Luckily the code itself was not effected.

    I tried the same thing by explicitly deleting the class from the model and re-inserting, and the child classes did not re-establish their parent relationship with the inserted class.

    I guess this should be considered a bug.

    MyEclipse version 4.02
    Eclipse 3.1
    Windows XP sp2
    Java 1.4.2

    #239344 Reply

    Riyad Kalla
    Member

    mikech,
    Thank you for the very detailed steps to reproduce this issue, we will look into it ASAP.

    #239386 Reply

    Kapil Kapre
    Member

    Mike,
    When you re-inserted the ‘middle’ class , did it form a relationship with its parent? (only)

    #239464 Reply

    Yes it did.

    #239465 Reply

    Kapil Kapre
    Member

    Mike,
    In a class hierarchy such as

    
    A
    ^
    |
    B
    ^
    |
    C 
    

    Removing B from the model, also removes all relationships B was in since they are now invalid (as per UML model, not Java model).

    Dropping B again into the model will create relationships that we know for sure are valid (A->B – extends clause).
    Remember that we parse just the java file which was dropped in, which obviously has no direct information about subclasses.

    Certainly there is potential in having such a feature allowing for a bit more intuitiveness in creation of relationships and achieve tighter coupling between Java Model <-> UML Model.

    Hope this helps,
    Kapil

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Removing and replacing class from model

You must be logged in to post in the forum log in