Hi, this blog is no longer maintained, my new blog is here

Ruby On Rails and a Conning Israeli entrepreneur

UML for Rails applications

UML is a Graphical language for visualizing, specifying and constructing the artifacts of a software-intensive system. The Unified Modeling Language offers a standard way to write a system's blueprints, including conceptual components such as business processes and system functions as well as concrete things such as programming language statements, database schemas, and reusable software components.[1] UML combines the best practice from data modeling concepts such as entity relationship diagrams, business modeling (work flow), object modeling and component modeling. It can be used with all processes, throughout the software development life cycle, and across different implementation technologies.
As the strategic value of software increases for many companies, the industry looks for techniques to automate the production of software and to improve quality and reduce cost and time-to-market.
These techniques include component technology, visual programming, patterns and frameworks. Businesses also seek techniques to manage the complexity of systems as they increase in scope and scale. In particular, they recognize the need to solve recurring architectural problems, such as physical distribution, concurrency, replication, security, load balancing and fault tolerance. Additionally, the development for the World Wide Web, while making some things simpler, has exacerbated these architectural problems. The Unified Modeling Language (UML) was designed to respond to these needs and to supply the programmers and the project managers with a visual application state and layout.
There isn't a clear why to implement the usage of UML for rails development, but here are the tools i did find.

  • RailsRoad is a RailRoad is a class diagrams generator for Ruby on Rails applications. It's a Ruby script that loads the application classes and analyzes its properties (attributes, methods) and relationships (inheritance, model associations like has_many, etc.) The output is a graph description in the DOT language, suitable to be handled with tools like Graphviz. Last tested on old rails versions!
  • A visual paradigm plugin for generating ruby (yap, not rails)
  • ruby-uml, couldn't find any documentations.
  • The generate_from_uml plugin does the oppsite and enerates rails models from a UML schema, i didn't see how advanced relations are handled though (:has_many :through for example)


  Jeroen van Dijk

March 15, 2009 at 10:17 AM

Hi Elad,

A why I could think of for uml usage is the graphical overview you have of your application, one you already mentioned. If you combine this with a generator that allows quick (re)generation of your design this gives you a tool for even faster prototyping and refactoring.

For the above reason, I created a generator that more or less scaffolds a datamodel defined in uml or yaml format. You can try it out
by running (with the rails 2.3 gem):
rails shop -m http://jeevidee.nl/instant_rails_application.txt

Or checkout my code on http://github.com/jeroenvandijk/dm_generator/

Note that it does more than just the generating of models (e.g. migrations, routes, controllers views). You can customize views by saying what attributes should in the form, index, show.

The code needs a rewrite and tests but currently works for me. Hopefully I can do this somewhere in the future.

Cheers, Jeroen

The Web Ask eizesus.com


    follow me on Twitter

    Twiters Around

    About Me

    My photo
    I am a web developer for more than 9 years, managed, cried, coded, designed and made money in this industry. now trying to do it again.

    Blog Archive