Entity architecture in Rails

Asked

Viewed 96 times

2

I am in doubt about how it would be the best way to represent an entity named client that may have sub-layers of the same entity.

Customer may own another Customer who is actually a carrier, and that Transposer may own another Customer who is a broker.

I thought about creating extended classes Cliente < Transportador < Corretor, since they all have basically the same attributes.

I’ve done a lot of this in Java but a rubista friend once told me he hated this kind of practice.

Below follows the structure and class diagram I thought of creating. inserir a descrição da imagem aqui

1 answer

0


Browser other questions tagged

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