Class Diagrams

  • Thread starter Nicholas Van Weerdenburg
  • Start date
N

Nicholas Van Weerdenburg

Hi,

Is there a popular cross-platform way to generate UML diagrams from ruby code?

Thanks,
Nick
 
A

Assaph Mehr

Not quite what you're looking for, but you can take a look at
ObjectGraph (objectgraph.rubyforge.org) at how to dymanically evaluate
classes and generate a png graph using GraphViz. You can set some
graphviz options to make the output *look* a bit more UMLish, but it's
not proper UML.

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

There is just one more question that need to be asked: are you sure
that is what you need? I find that because of ruby compactness of code
and duck-typing arguments you rarely use much of inheritance etc. As
for activity diagrams, you can not normally get them from static code
analysis so you'd have to do them by hand anyway.

Cheers,
Assaph
 
E

Eric Hodel

--Apple-Mail-52--533391908
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

ParseTree will get you started on such a tool.

--
Eric Hodel - (e-mail address removed) - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

--Apple-Mail-52--533391908
content-type: application/pgp-signature; x-mac-type=70674453;
name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)

iD8DBQFB9blrMypVHHlsnwQRAj4qAKDBejMBHXTM3SvaPokhQwXZ8fMPVwCg58fW
nDJMBJkMNWmqawoQQ9a2JPg=
=aBPl
-----END PGP SIGNATURE-----

--Apple-Mail-52--533391908--
 
N

Nicholas Van Weerdenburg

Not quite what you're looking for, but you can take a look at
ObjectGraph (objectgraph.rubyforge.org) at how to dymanically evaluate
classes and generate a png graph using GraphViz. You can set some
graphviz options to make the output *look* a bit more UMLish, but it's
not proper UML.

I am not aware of any tool that reads ruby to generate UML (and would
love to hear if there are!). You might have to follow the same process
as ObjectGraph, but generating an XMI document to load into an existing
tool.

There is just one more question that need to be asked: are you sure
that is what you need? I find that because of ruby compactness of code
and duck-typing arguments you rarely use much of inheritance etc. As
for activity diagrams, you can not normally get them from static code
analysis so you'd have to do them by hand anyway.

Cheers,
Assaph

I might be happy with objectgraph. I like UML, but hate UML tools. So,
I figure I could write Ruby and use a tool to visualize the code for
insight and creating documentation.

I'd also find it interesting to apply it to existing Ruby libraries to
get a sense of their structure.

Whether it is really useful, I won't know until I try :).

Thanks,
Nick
 
N

Nicholas Van Weerdenburg

I've meaning to look at it, but haven't had the time to-date.

Thanks,
Nick
 
R

Ryan Davis

I've meaning to look at it, but haven't had the time to-date.

Glom your orbs on this:

http://blog.zenspider.com/archives/2005/01/parse_tree_visu_1.html

(be sure to look at the "ginormous" link as well)

Not quite what you are asking for, but a good start and very very easy
to move in the direction you'd like. The code is only 66 lines for the
graph class, 61 lines for the sexp processor, and 86 lines to process
command line options and snoop classes. Not bad, eh?
 
N

Nicholas Van Weerdenburg

Glom your orbs on this:

http://blog.zenspider.com/archives/2005/01/parse_tree_visu_1.html

(be sure to look at the "ginormous" link as well)

Not quite what you are asking for, but a good start and very very easy
to move in the direction you'd like. The code is only 66 lines for the
graph class, 61 lines for the sexp processor, and 86 lines to process
command line options and snoop classes. Not bad, eh?

Very nice. And nice sql table diagrams as well for your book web app.

Nick
 
G

gabriele renzi

Nicholas Van Weerdenburg ha scritto:
I might be happy with objectgraph. I like UML, but hate UML tools. So,
I figure I could write Ruby and use a tool to visualize the code for
insight and creating documentation.

I'd also find it interesting to apply it to existing Ruby libraries to
get a sense of their structure.
metoo!

Whether it is really useful, I won't know until I try :).

Thanks,
Nick


just a thing: there is rdoc --diagram that may help. Very little, but
better than nothing :)
 
N

Nicholas Van Weerdenburg

Nicholas Van Weerdenburg ha scritto:


just a thing: there is rdoc --diagram that may help. Very little, but
better than nothing :)

I didn't even know there was such a thing. I'll check it out.

Thanks,
Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,166
Messages
2,570,902
Members
47,442
Latest member
KevinLocki

Latest Threads

Top