11 months ago

When should I use Polymorphic Relationships?

Posted 11 months ago by fabricecw


I'm a little bit confused of when I should use Polymorphic Relationships and when a normal relationship would be the better approach.

I've been thinking about a question which I could ask to myself. I got the following idea of the question's "syntax":

Is there anything else which is modelable?

As an example for a Ordermodel:

Is there anything else which is orderable?

Which could be a model Bookor Chair.

An other example would be a Comment:

Is there anything else which is commentable?

Do I get the right thoughts or is this mindset wrong? Thanks for your feedback!

Please sign in or create an account to participate in this conversation.