Question

Could any one recommend some good UML/modeling tools for Ruby and Ruby on Rails? It would be nice to generate code from UML diagrams as well as generate diagrams from existing code.

Was it helpful?

Solution

Check "UML tools for Ruby" (i.e. tools that generate some Ruby code from UML diagrams or, the other way round, that generate some UML diagrams from Ruby code.)

OTHER TIPS

What do you mean by "for Ruby"? UML is language-agnostic.

Based on your comment - UML is a generic, language-independent model. It's designed (from my understanding) to be used before an implementation language is chosen, so not all of the UML elements have corresponding elements in all languages (eg - interfaces in Ruby). However, that doesn't mean that you can't make UML models and implement the system they describe in Ruby.

I recommend StarUML for all UML needs.

Visual Paradigm is a Mac application and will do this for you.

Somewhat OT, but the best UML tool I've found is called Enterprise Architect -- it's a Windows application, and it costs around $130 for a basic license. It doesn't do Ruby, but it does do Java, C++ and a host of other languages, including full database to SQL, both generation and reverse engineering. It's worth a look.

The original Railroad gem only works for Rails v2 and prior. If you're using Rails 3, use the RailRoady gem instead. (Also see the README on github.)

Do you meant to ask for a tool which transforms UML into ruby code?

I dont think there is any at the moment. But its a very good application idea :)

I have found the ruby-uml

Generates uml diagrams by tracing the run of an application for analysation of an existing application and to provide support for refactorisations.

I know I'm catching on this message a little late, however I think I've got a few things to add here.

Uml (class diagrams) doesn't work well with dynamically typed languages. I'm not talking about specific cases like language-specific constructs, but about something more fundamental.

In ruby, variables don't have any type. In UML, we create associations between types.

Ruby uses duck-typing. Duck-typing can easily be mapped to classes implementing a certain interface. However, since all classes are self contained and entirely decoupled from each other, I like to see each ruby class as a component.

I created a rubygem tool that you might check out. It was a bit challenging to do, and it doesn't work very well yet, however it allows to extract Ruby code (not Rails, Rails models are typed, since they are mapped to databases. They even have cardinalities for associations) and to generate a uml diagrams from it. https://github.com/mikaa123/umlify

Railroad generates UML class diagrams for Rails applications, including Models and Controllers, you might want to take a look at http://railroad.rubyforge.org/

If you use Linux, you may certainly enjoy Umbrello, an UML modeller which generates code in many languages, including Ruby.

https://umbrello.kde.org/

I think you might get some mileage from http://yuml.me all you would need to do is output some text.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top