UML Questions for Rails System

Asked

Viewed 233 times

3

My question is this. Rails controllers, for basic CRUD operations, require various methods that are repeated throughout the application’s controllers. I’m drawing the diagrams for a TCC application that has several CRUD’s, and so I’m finding the class diagrams very repetitive.

For example, I have the Employees, Clients and Products classes. They all have the new, create, index, show, Edit, update, delete and Destroy methods. Repeating this in the diagrams of the three classes may raise the question: "But would not an inheritance be better?". Maybe, and even wouldn’t hurt DRY. Now, here’s the question. How can I do that? Does anyone have anything to suggest? Or this repetition in the diagrams is no problem?

1 answer

2


In your UML diagram you must put the attributes (table fields) and methods of the model, and not the controller.

In MVC, methods are not always created in model classes, controllers are used more often. But if you have some model-specific logic, can put there (does not mean that must, That depends on the case).

See also: http://www.guj.com.br/java/114981-uml-para-mvc

Browser other questions tagged

You are not signed in. Login or sign up in order to post.