Entity Architecture in Rails

2

I'm in doubt about what would be the best way to represent a client name entity that may have sub-layers of the same entity.

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

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

I've done a lot of this in Java but a Rubista friend once told me that he hated this kind of practice.

Below is the structure and diagram of classes I thought of creating.

    
asked by anonymous 06.01.2016 / 14:37

1 answer

0

After studying the guide link I solved the problem of self join. Now I have been able to map the Clients of a broker and the Brokers of an Insurer.

    
07.01.2016 / 14:19