title: In context of CQRS and DDD how would you handle slightly varying use cases?
body: <p>I could have a command for each variation or I could have one command and handle variations within it.</p>
  
  <p>To illustrate, I have three use cases (or more), "CommentOnPhoto", "CommentOnWall", "CommentOnArticle". All of them internally use the same commenting system. The difference between three is:</p>
  
  <ul>
  <li>Different policy needs to be checked (<code>CommentOnPhotoPolicy</code>, <code>CommentOnWallPolicy</code>, <code>CommentOnArticlePolicy</code>)</li>
  <li>Different aggregate has to be pulled from repository so that we could call, <code>photo.attachComment(comment)</code>, <code>article.attachComment(comment)</code>, etc.</li>
  </ul>
  
  <p>If going the route of one command for each variation then should each command inherit from some base <code>CommentOnSomething</code> command since they are all very similar?</p>
  
  <p>If going the route of one mother command for all use cases then we will have to make use of Service Locator to pull needed Policies and Repositories on demand (we don't want to inject 10+ dependencies for each use case only to use one). Is this acceptable if we make use of abstract factories and such to hide away service locator use? Meaning we have <code>CommentPolicyFactory</code> and <code>CommentableFactory</code> which use Service Locator internally to deliver the right policy and the right aggregate.</p>