How to represent database columns and instance variables in UML

145 views Asked by At

I am using Ruby 1.9 and Rails 2.3. I am designing class diagrams for Model classes. I was stuck with two doubts.

1.How to differentiate database columns and instance variables in Class diagram variables section.

2.In Ruby Active record created setters and getters for database columns automatically, In this case do i need to represent database columns in methods section or variables section.

Note: I have researched for gems, but i am not getting expected result with some gems like umlify and some gems are not supported with my current versions like Railroady.

Thanks for the answers.

1

There are 1 answers

0
qwerty_so On BEST ANSWER

You can assign a stereotype to the database column like <<column>>. That will clearly differentiate between columns and instance variable.

In EA you can create properties for a couple of languages, but not for Ruby. What EA does in those cases is to create <property get> and <property set> stereotyped methods and then leaves them as they are (so if you change the name of the property is does not change the methods). You can do the same manually or support that with a little script.