Relationship arrows wrong?

General discussions about code engineering

Moderator: Moderators

Relationship arrows wrong?

Postby smadirondack » Sat Jun 04, 2011 4:39 pm

I'm reverse engineering some Java code. The relationship arrows aren't what I expect.

In the Class Diagram Wizard and Choose relationship types
I clicked on the following relationships.
Generalization
Realization
Association


Even so, the relationships aren't showing.
Here is an example: there should be a realization between the following but a directed association is there instead.
public interface EligibilityChecker
public class GameEligibilityChecker implements EligibilityChecker

What can be done? How am I not getting the expected results?

Thank you.
Scott
smadirondack
Forum Newbie
Forum Newbie
 
Posts: 14
Posts Rating:0
Joined: Fri Jun 03, 2011 1:09 pm

Re: Relationship arrows wrong?

Postby egiva » Mon Jun 06, 2011 3:24 am

Hello,

We cannot reproduce this situation. Could you check, if "Interface Realization" is correctly created in the data level (in a browser)? Relationship must be placed under class "GameEligibilityChecker" in a browser. Could you send MagicDraw model to our support? Go to help-> Register an Issue and register issue with an project attached.

I have tried your sample following:
- reversed java class with interface
- started Class Diagram Wizard
- selected class and interface to be visualized in diagram
- choosing Generalization, Realization, Association
- diagram shows correctly class and interface connected with "Interface Realization"
Best Regards,
Egidijus Vaisnora
egiva
Customer Support
Customer Support
 
Posts: 37
Posts Rating:0
Joined: Tue Jan 05, 2010 6:32 am

Re: Relationship arrows wrong?

Postby smadirondack » Mon Jun 06, 2011 6:57 am

I'm sorry, I'm a newbie. I was unable to find help-register an issue. However, please see my attachment for the java source code to my issue.
You do not have the required permissions to view the files attached to this post.
smadirondack
Forum Newbie
Forum Newbie
 
Posts: 14
Posts Rating:0
Joined: Fri Jun 03, 2011 1:09 pm

Re: Relationship arrows wrong?

Postby smadirondack » Mon Jun 06, 2011 8:22 am

Here are the steps I use:

Start-up Magic Draw
<Ctrl-n>
Enter "Goalkeeper" in the Name field
Click on "Project from existing source code"
Enter "C:\...\com\compoz\goalkeeper\" in the Project location field
Enter "Java" in the Language field
<ok>

In the "Round Trip Set" dialog box:
Change "working directory" from <install.root> to "C:\gwt\Goalkeeper"
The working package is "data"
In the all files tree select "src" then click <Add Recursively>
Click <ok>

In the "Reverse Options" dialog:
Create class fields as: Associations
Check: Resolve collection generics
Check: Visualise reverse model
select: Create new Class Diagram
Check: Create dependencies between Classifiers
Check: Create dependencies between Packages

In the module visualizer dialog
Select "Class diagram wizard"
<start>

In the new class diagram wizard dialog:
Type class diagram name: GoalkeeperClassDialog
Select owner for diagram: left at "data"
<next>
Choose elements step (no change) <next>
Choose relationship types (all are checked) <next>
Specify symbol properties (no change) <finish>

The class diagram is created.
There are only two arrow types dotted
- - - - ->
-------->
smadirondack
Forum Newbie
Forum Newbie
 
Posts: 14
Posts Rating:0
Joined: Fri Jun 03, 2011 1:09 pm

Re: Relationship arrows wrong?

Postby egiva » Tue Jun 07, 2011 5:15 am

Hello Scott,

All you did is correct. I won't recommend you to use check boxes Create dependencies between Classifiers and Create dependencies between Packages, because these are for model analysis. It forces to create analysis dependencies in the model but these dependencies overload diagram. Try to do these steps without these properties.

After you get diagram, you should be able to see InterfaceRealization link between Class and interface there. I just noticed odd behavior that after project was first time created, the displayed diagram contains InterfaceRealization link, but after I clicking on it - it disappears. After closing and reopening diagram it behaves normally.

Help-> Register an Issue is the command in MagicDraw main menu
Best Regards,
Egidijus Vaisnora
egiva
Customer Support
Customer Support
 
Posts: 37
Posts Rating:0
Joined: Tue Jan 05, 2010 6:32 am

Re: Relationship arrows wrong?

Postby smadirondack » Mon Jun 13, 2011 10:05 am

Egidijus,

Thanks for the reply. I need to explain my expectation better. Sorry. I was expecting the automatic diagram creation to create the diagram with the realization arrows already created. I did not expect to have to manually add a realization arrow where it should belong. From your reply to my post it seems you are showing me how to "draw" a realization relationship. Instead, I was expecting it to already be drawn for me.

So, in a situation where a class implements an interface I would expect the generated diagram would show the realization arrow pointing from the class to the interface. Please let me know if my expectation is false.

Best regards,

Scott Mitchell
smadirondack
Forum Newbie
Forum Newbie
 
Posts: 14
Posts Rating:0
Joined: Fri Jun 03, 2011 1:09 pm

Re: Relationship arrows wrong?

Postby egiva » Tue Jun 14, 2011 1:48 am

Scott,

I had made the steps you told me, and interface realization link was created in the diagram. Could you check, if interface realization is crated in the data? You can see it in MagicDraw browser, containment tree, located under class node. If realization is in the data, then select Interface Realization in browser and try to invoke action from the right mouse click: "Go To-> Usage in diagrams-> Diagram". It will select link in diagram. If link is not created in any diagram, then no diagram will be listed in menu.

If still there are problems, please send your model for detail investigation. There are two files with extensions: mdzip and mdr.
Best Regards,
Egidijus Vaisnora
egiva
Customer Support
Customer Support
 
Posts: 37
Posts Rating:0
Joined: Tue Jan 05, 2010 6:32 am

Re: Relationship arrows wrong?

Postby smadirondack » Tue Jun 14, 2011 3:33 pm

Thanks again Egidijus,

Attached please find a pared down example of the problem I'm having. In this example There is an interface called "Runner" and a class "MarathonRunner" that implements it. Also in the zip file is the magicdraw files for my attempt at reversing the code into a model. In this case there are now arrows at all.

If it works for you, please provide exact step by step instructions.

Also, my MagicDraw Build is 2011 05 27 15:59 (109383).

Thank you,

Scott Mitchell
You do not have the required permissions to view the files attached to this post.
smadirondack
Forum Newbie
Forum Newbie
 
Posts: 14
Posts Rating:0
Joined: Fri Jun 03, 2011 1:09 pm

Re: Relationship arrows wrong?

Postby egiva » Wed Jun 15, 2011 5:12 am

Scott,

Seems problem with MagicDraw version, you are running. MagicDraw 17.0 sp2 has bug in InterfaceRealization creation. Try to downgrade to 17.0 sp1 and then reverse your files. Here is download link if you do not have older version installs: http://69.36.189.184/files170sp1/MD_UML_170_sp1_win.exe
Best Regards,
Egidijus Vaisnora
egiva
Customer Support
Customer Support
 
Posts: 37
Posts Rating:0
Joined: Tue Jan 05, 2010 6:32 am

Re: Relationship arrows wrong?

Postby smadirondack » Wed Jun 15, 2011 2:27 pm

Egidijus, the Realization arrow showed up. That is cool.

I just tried aggregation, though, and it doesn't behave as expected. It makes me think that composite relationship won't either...

Please see attachment.

class SmallApp {
MarathonRunner[] mr = new MarathonRunner[2];
...
}
You do not have the required permissions to view the files attached to this post.
smadirondack
Forum Newbie
Forum Newbie
 
Posts: 14
Posts Rating:0
Joined: Fri Jun 03, 2011 1:09 pm

Next

Return to Code engineering

Who is online

Users browsing this forum: No registered users and 0 guests