facebook

Duplicate Class Names Allowed

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

    John Hebley
    Member

    It seems that duplicate class names are allowed in a class diagram. This has interesting repercussions, as I have just found out. Somehow I created two classes with the same name. One had attributes, the other did not. The one on my model had the attributes and clearly showed in the outline list. (I did not notice the “Diagram-Centric” heading) Every time I tried to generate Java code from the model, my class file appeared, but with no class variables defined, even though they were clearly shown as attributes on my model.

    After much poking around I switched to “Class-Centric” outline view and there they were, two classes, one with attributes and one without. Naturally, the one without was first in the list, so the happy old Java code creator used that definition, not the one I had intended, and had used in my model.

    Moral to this story is, be careful of duplicate class names. Hint to tool developers – why allow duplicate class names?

    – John

    #261504 Reply

    Riyad Kalla
    Member

    John,
    I think this was an oversight, thank you for bringing it to our attention.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Duplicate Class Names Allowed

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