title: multiword method names/class vs separate class
body: <p>I'm building a small forum app where a <strong>user</strong> has a <strong>profile</strong> and on that profile, the user who owns the profile as well as other users, can make <strong>posts</strong> ( pretty much the same concept as with fb ).</p>
  <p>My concern is whether it is better to have <strong>multi-word classes</strong> or whether it is better to have a <strong>separate class for each word</strong>.</p>
  <p>For example, if i have a <strong>profile</strong> on which i can create <strong>posts</strong>.</p>
  <ul>
  <li>Would it be better to have a model <strong>Profile</strong> and a model <strong>Posts</strong></li>
  <li>Or it is better to have a <strong>ProfilePost</strong> model</li>
  </ul>
  <p>My approaches so far are the following</p>
  <ol>
  <li>The tables for the first approach</li>
  </ol>
  <pre><code>users
  - id
  
  profile
  - id
  - user_id
  
  posts
  - id
  - body
  - profile_id
  
  comments
  - id
  - body
  - poster_id
  - post_id
  </code></pre>
  <p>Where <strong>poster</strong> is the user who creates the <strong>post</strong></p>
  <ul>
  <li>The <strong>user</strong> has a <strong>profile</strong></li>
  <li>The <strong>profile</strong> has <strong>posts</strong></li>
  <li><strong>Posts</strong> have <strong>comments</strong></li>
  </ul>
  <p>As a result, if i want to add a new post, then i'd have to make multiple joins, for example</p>
  <pre><code>$user-&gt;profile()-&gt;posts()-&gt;addBy($anotherUser, $post)
  
  $user-&gt;profile()-&gt;post($post)-&gt;addCommentBy($comment, $anotherUser)
  </code></pre>
  <ol start="2">
  <li>The tables for the second approach are</li>
  </ol>
  <pre><code>users
  - id
  
  profile_posts
  - id
  - body
  - profile_user_id
  - poster_id
  
  comments
  - id
  - poster_id
  - profile_post_id
  </code></pre>
  <p>And the approach to create a post and a comment will be like</p>
  <pre><code>$user-&gt;postToProfile($profileUser, $post);
  $user-&gt;profilePost($post)-&gt;addComment($comment);
  </code></pre>
  <ul>
  <li>The <strong>first</strong> approach requires multiple joins but the naming seems more elegant to me.</li>
  <li>While the  <strong>second</strong> approach consists of multiwords such as <strong>profilePost</strong> which seems like these words can be extracted into their own classes.</li>
  </ul>