Mapping vs composition <p>If I have two classes with a one-to-one relationship, when's a good time to use mapping.</p> <pre><code>class A { ... } class B { ... } class C { Map&lt;A,B&gt; a2b; } </code></pre> <p>And when's a good time to use composition?</p> <pre><code>class A { B myB; } class B { ... } </code></pre> <p>Would the answer change if the relationship was one-to-many and many-to-many?</p>