tool to draw some kind of UML-like diagram?

hi,

does anyone know of a good free tool that can be pointed at a classpath and generate a diagram of packages, where the public classes of each package are shown, with dependencies between the packages shown by arrows etc..

is this the same as a "UML package diagram" - afaik these don't show public classes?

thanks,

asjf

[362 byte] By [asjf] at [2007-9-30 7:11:21]
# 1
I've heard good things about [url= http://argouml.tigris.org/]argouml[/url], but I've never used it myself.
jverd at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

thanks - my problem with argouml is that it doesn't generate the diagrams though - you have to draw them?

someone else has asked this here

http://answers.google.com/answers/threadview?id=112361

i don't want to pay money really either, but this looks quite good

http://wwwcs.upb.de/cs/ag-schaefer/Lehre/PG/Fujaba/index.html

but doesn't seem to have been designed with laying out packages. The project I want a birds-eye view of isn't particularly big (prob. about 400 classes in total) but its not very easy to see what its doing with fujaba

asjf at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
> thanks - my problem with argouml is that it doesn't> generate the diagrams though - you have to draw them?Oops. Sorry. Misread your question.
jverd at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 4
I suppose you could halfway roll your own. If you can find one that can read XMI, you should be able to whip up some code that would examine a classpath and spit out XMI.
jverd at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 5

> I suppose you could halfway roll your own. If you can

> find one that can read XMI, you should be able to whip

> up some code that would examine a classpath and spit

> out XMI.

i already did! (well it outputs GML which can be used with ygraph's yed graph viewer) the problem is that it doesn't do the public class bit - it only shows packages and their dependencies

running it against rt.jar produces a big black highly connected ball which is a shame, my (very much simpler) code has some structure to it but not as much as i'd hoped

yed does have some provision for nesting nodes within other nodes which is how you'd get a package with public classes i suppose, but my attempts are a lot less satisfactory than seeing it done properly (eg the fujaba thing seems excellent in terms of what it does do so far, it just needs to get more advanced..)

googling has also shown up some expensive looking commercial things, but it doesn't seem worth the cost?

asjf at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 6
> Oops. Sorry. Misread your question.<promises to use better thread titles in future>
asjf at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 7
You're saying that ArgoUML won't do the reverse engineering - suck in your Java source and generate the diagrams for you?The only products that I've seen do that are Together J and Rational Rose. Lots of bucks for both.%
duffymo at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 8
Check out Omondo at http://www.omondo.com/it's an integrated tool for Eclipse IDE.It will perform reverse engineeringIt free for non-profit and academic usethere is a free version of it, but I don't know if the free version support reverse-engineering.
tnguyen1973 at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 9

> Check out Omondo at http://www.omondo.com/

> it's an integrated tool for Eclipse IDE.

> It will perform reverse engineering

> It free for non-profit and academic use

> there is a free version of it, but I don't know if the

> free version support reverse-engineering.

thanks, i've got hold of it now.. but have not yet worked out how to use it.. (the tutorials page is not finished on the website..)

I've got hold of Eclipse 2.1, and the appropriate omondo installer jar, installed it, its appeared in the eclipse plugins directory but is no-where to be found in the IDE. Its not in the Other Perspetives list or anything? am I missing something here?

any help appreciated,

thanks,

asjf

asjf at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 10

> any help appreciated,

> thanks,

> asjf

some simple steps:

first of all, make sure you got the 2.1 version for eclipse 2.1, then

create a new uml project, if you want to do a lot, or

right click on your src directory => class digram...

... and that's it. this eclipsuml from omomdo is very good, you can do everything!

i hope this helps you, and i hope you, and everyone else, can help me with my question:

i currently use clipse with this uml plug in and websphere 5, which comes in with another uml tool namely uml visualization. i noticed that eclipseuml lets you draw association relationships, either composition or aggregation, but websphere uml does not let you do that. i might miss something on how to use it properly in websphere, a thought that occured to my mind was that if it is worthy to draw the composition/aggregation relationships any more? or if the associations of composition and aggregation serve any practical purpose in your design work?

what is the current version of uml? (if there is such a thing)

Guest at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 11

> some simple steps:

wow.. its great! thanks v. much - it doesn't seem to do the package-level diagrams I'm after but is something great to play with..

btw. are you really daFei? you have not been on the forums for a long time?

> and i hope you, and everyone else, can help me with my question

sorry - this is all new to me as you can probably tell..

asjf at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 12

> > some simple steps:

>

> wow.. its great! thanks v. much - it doesn't seem to

> do the package-level diagrams I'm after but is

> something great to play with..

>

if i understood you correctly: you have written many packages, and want to have it in digrams, right? it should work for you, then. it does class level, and package level as well, look into the preference area.

right click on your src to have a default thing, with all your packages in it, then dump all your classes into their packages, and that's it.

> btw. are you really daFei? you have not been on the

> forums for a long time?

>

just had a chat with jschell on pass by reference or value.

> > and i hope you, and everyone else, can help me with

> my question

>

> sorry - this is all new to me as you can probably

> tell..

same here, nver paied much attention to uml before but i am now, as i am aging...

Guest at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 13

> if i understood you correctly: you have written many

> packages, and want to have it in digrams, right? it

> should work for you, then. it does class level, and

> package level as well, look into the preference area.

>

> right click on your src to have a default thing, with

> all your packages in it, then dump all your classes

> into their packages, and that's it.

hm.. sorry i still can't get this working.. I've tried right clicking on the root of each of the following trees

1) Package Explorer

2) Hiearchy (this ones blank..)

3) Navigator

but none have a UML option. Clicking on a particular package icon in the package explorer gives the "Class Diagram Editor..." link which generates a class diagram

Also, the preferences page has

UML -> Class Diagram -> Dependencies Detection -> Package Level

and i've ticked that just in case, but nothing more is happening..

> same here, nver paied much attention to uml before but

> i am now, as i am aging...

tell me about it..

the omondo website has a page here which says that the UML level currently supported is 1.2

http://www.omondo.com/features.jsp

asjf at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 14
> just had a chat with jschell on pass by reference or> value.And since you didn't respond to my last point in that thread you must now understand how it works.
jschell at 2007-7-1 23:26:09 > top of Java-index,Other Topics,Patterns & OO Design...
# 15
That thread proves that although greatly improved, this is the real daFei.
pkwooster at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 16

ah, every 1, hello:)

to asif:

yeah, enable the package level (default settings enables class level only), just right click on your package directory and create a class digram, you will get a package full of all classes of that package in the diagram. the dependencies at package level will be drawn for you also. if it doesnt work the first time, delete the file and redo it, repeat till you get it right:)

on that good old thread on pass by ref or val:

i think the definition of pass by ref or val has been redefined at least once. since when i dont know. my programming career started with c/c++, i have been using the definition of c/c++, which, after doing a bit reading on fortran (although i should take all the risks to trust jschell, and pkwooster as well, on fortran matters, i neverthless did some reading on it), is very different from that in the (early)fortran times. pass by ref in (early)fortran means using references from the commom block without making copies into local registers.

in early times, fortran/mainframe, pass by reference means getting references in the COMMON block, and pass by value means making copies out of the COMMON block into local registers. the later was called smart compilers since making copies into local memories works better. so i guess when people or sun say java uses pass by value, they mean java works like a smart compiler, making local copies of what is passed in.

i feel soon after fortran knew how to pass by values, and especially since after c came into being, everyone has been doing pass by values, and this smart compiler thing has since become a commom place and hence the term pass by reference has a new meaning, it means making cpoies of memory address, instead of copying whole objects. java of course makes copies of values passed in, and in this sense it is doing pass by value, yet the copies it makes are memory addresses, when dealing with objects, it is called pass by reference by modern definition, or, as suggested sometimes, pass by reference by value.

do i still miss anything? not likely, simple things, just a bit confusing:)

Guest at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 17
> > do i still miss anything?Yes, but this is the wrong thread to discuss it. It should be here.... http://forum.java.sun.com/thread.jsp?thread=508825&forum=13&message=2444651
jschell at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 18
Eclipse Omondo Plug-inGoogle Omondo UML
Mordan at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 19

> Eclipse Omondo Plug-in

>

> Google Omondo UML

thanks - i have this and its working great

I've still not been able to get hold of the diagram I'm after, which would

1) have a box per package, with the package name

2) have an arrow between to boxes if one package contained a reference anywhere to another

and ideally

3) have the (known to be public) classes which reference each other shown as "ports" on the boxes

i've made a program that does 1 & 2 itself - you can get check the constant pools in each of the class file images in the package in question to make the graph. I'd prefer to do this with Omondo or something because my code is extremely heath robinson and a bit of a chore to invoke..

(also I've got hold of the EMF but can't figure out if this is any different?)

thanks,

asjf

asjf at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 20

>

> 1) have a box per package, with the package name

> 2) have an arrow between to boxes if one package

> contained a reference anywhere to another

>

Not sure why you would want that. I would probably just draw it myself. After all a single reference would define it.

> and ideally

>

> 3) have the (known to be public) classes which

> reference each other shown as "ports" on the boxes

>

I can't see a use for that.

What would the java.lang package look like? You would have 90% of the methods referenced, and it would probably be unreadable.

jschell at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 21

> >

> > 1) have a box per package, with the package name

> > 2) have an arrow between to boxes if one package

> > contained a reference anywhere to another

> >

>

> Not sure why you would want that. I would probably

> just draw it myself. After all a single reference

> would define it.

its proved quite useful for a RealWorld project i'm working on at the moment - there were two or three dependencies that shouldn't have been (and weren't) necessary, and also pointed me in the right direction for splitting one package into two (because too many varied things depended on it)

i'd agree that this information is available straight from the source code, but its nice to have it summarized on a bit of A4 paper that you can show to people and scribble over to show how it should be

> > and ideally

> >

> > 3) have the (known to be public) classes which

> > reference each other shown as "ports" on the boxes

> >

>

> I can't see a use for that.

>

> What would the java.lang package look like? You would

> have 90% of the methods referenced, and it would

> probably be unreadable.

i did run my heath-robinson code against rt.jar to see what it would look like and yes, its not a very useful picture :) - although if you only look at java. and javax. (not .org or sun. etc..) then there is some discernable structure, kind of.

just to be clear - i wouldn't want method/field information visible. Again i can only hope to justify this by going back to the project above. In "java.lang" nearly all of the classes are public so (3) would only make things worse

A typical package in my project has around 10-15 classes of which less than five are (or should be..) public, and so these are the only points where packages can depend on each other but they don't necessarily need all of the classes that are public and its been quite useful justifying why one package should need to know about another in this way

you can see the same thing with a class dependency diagram, but some problems are:

1) automatic graph layout algorithms can scatter classes from the same package to other ends of the display

2) you get parallelish tracks of dependencies (or worse, fans) confusing the diagram

asjf at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 22
There are reference utilities that print out dependency information for java.
jschell at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 23

> There are reference utilities that print out

> dependency information for java.

do you think i'm going in the wrong direction with the diagram stuff then?

i've not found anything that i've found useful immediately (eg did not get far with JDepend), but will go back for another look if thats the way other people do it..

asjf at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 24
If I wanted to make sure there were no unusual dependencies I would use a dependency tool. Since there might not only be problems between packages but between classes as well.
jschell at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 25
And if you do find an acceptable dependency tool post it here.
jschell at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...
# 26

Sorry I am late to this discussion, but for a good tool to draw UML Like Diagrams I would go to:

www.visual-paradigm.com

It does reverse engineering, class, sequance, user diagrams, etc... and its free. Atleast the personal edition is. It is relatively cheap. I know, I have user Rational, and it is some major bucks. You can even get different downloads to integrate with you ide. I got the one that integrates with netbeans.

Anyway, if I am late to the party sorry!?

orozcom

orozcom at 2007-7-1 23:26:12 > top of Java-index,Other Topics,Patterns & OO Design...