I have two main entities (db tables)
I have a bridge tabled called Projec
In general there are two approaches, as you've correctly mentioned:
one-to-many
and many-to-one
many-to-many
I (my personal statement) would avoid many-to-many
in almost any scenario (while in some very rare, really admin object scenario could be used).
Here are some of my tries, to explain that:
To add more here, I would firstly mention, that with many-to-many
we are loosing the pairing object from the model. Forever. So, once our customer will come and ask: please, make one of my relations Main, or introduce the Sorting - we simply cannot. The relation is as it is. No way how to extend it.
And secondly, and most likely - very likely: our customer will come and ask: Could you create a filter for me, selecting only Projects
which are related to Application
having some setting set to true AND ...
And that would be a bit challenging in many-to-many
case.
The scenario with explicit pairing object brings more overhead with that third Entity. But could be converted into Subqueries
There are some examples of the Subquery
power:
Well, that is my point of view. Not saying it is correct. But my experience shows, that with explicit pair object mapping we are ready for extensions as well as for complex queries.