- This topic has 3 replies, 3 voices, and was last updated 19 years, 1 month ago by Christian Lewold.
-
AuthorPosts
-
Christian LewoldMemberHoi Folks,
I play around a bit with the UML feature of 4.0 GA right now. I might have found a problem, and want to verify if it is not a silly mistake on my side:
-) I create a package “com.main”
-) I create a package “com.sub”
-) In “com.main” I create an interface “MyInterface” with the method “test”
-) In “com.sub” I create a class “MyClass” implementing “MyInterface” (Using Realization – is that correct ? )====> UML->Generate Java
Problems:
P1) the method “test” is not implemented in “MyClass”. Might work as intentded, but consider there are many methods in the interface. It really would be annoying if I have to manually enter the methods. Is there an easy way to add methods as defined in interfaces?
P2) the “inherits MyInterface” statement is correctly added. The import statement for the interface is missing though.
P3) I manually fixed the problem in the code and wanted to update the class diagram. I dragged the corrected MyClass to the diagram – suddenly I had 2 classes “MyClass” there (bad)
P4) I deleted the “old and wrong” “MyClass”. Now the correct one (with proper imports, methods etc.) is on the diagram, but no connections to the other classes are shown. (particulary the “realization of MyInterface”). Is there a way to add that ? (Show->Show all Edges didn’t work with this class, although it works if the class is created in the Editor originally).As I said – I just toy around with it since about 2 hours. Right now I have the impression that you had a “good start”, but the road is still long …. (but of course all of above could also be silly user errors)
/salute
Chris
Riyad KallaMemberChris someone from the UML dev team will look into this right away.
Kapil KapreMember@lewold wrote:
Hoi Folks,
I play around a bit with the UML feature of 4.0 GA right now. I might have found a problem, and want to verify if it is not a silly mistake on my side:
-) I create a package “com.main”
-) I create a package “com.sub”
-) In “com.main” I create an interface “MyInterface” with the method “test”
-) In “com.sub” I create a class “MyClass” implementing “MyInterface” (Using Realization – is that correct ? )Chris to create a package hierarchy , you’ll have to create a it in a different way.
1. Create package com
2. Create package main
3. Create package sub
4. Set the Namespaces of main and sub as com in their properties.
( Step 4 can also be done in the outline view using drag and drop )
@lewold wrote:Problems:
P1) the method “test” is not implemented in “MyClass”. Might work as intentded, but consider there are many methods in the interface. It really would be annoying if I have to manually enter the methods. Is there an easy way to add methods as defined in interfaces?Sorry, ATM we dont support automatic interface method implementation.
@lewold wrote:P2) the “inherits MyInterface” statement is correctly added. The import statement for the interface is missing though.
P3) I manually fixed the problem in the code and wanted to update the class diagram. I dragged the corrected MyClass to the diagram – suddenly I had 2 classes “MyClass” there (bad)
P4) I deleted the “old and wrong” “MyClass”. Now the correct one (with proper imports, methods etc.) is on the diagram, but no connections to the other classes are shown. (particulary the “realization of MyInterface”). Is there a way to add that ? (Show->Show all Edges didn’t work with this class, although it works if the class is created in the Editor originally).These problems should dissapear when you create the package hierarchy as stated.
I understand its a bit un-intuitive and we will be fine tuning MyUML in subsequent releases.
Also we have fixed a couple of other issues in MyUML post 4.0GA and I would recommend you to update to avoid facing already fixed issues.
Thanks,
Kapil
Christian LewoldMemberThanks for your fast reply folks.
Well – imho you should consider the package logic again. When working with e.g. package diagrams, then one usually wants to see “one” package called e.g. “com.test.mysub.pkg1”, and not 4 different ones. Well, actually it’s a matter of how to display the stuff (similar as one can change the view in “native” eclipse).
But for now it works – thanks again for the hints
-
AuthorPosts