title: Too big data objects
body: <p>Recently, I have identified very strong code smell in one of the project, I'm working for.</p>
  
  <p>Especially, in its cost counting feature. To count the total cost for some operation, we have to pass many kind of information to the "parser class".</p>
  
  <p>For example:</p>
  
  <ul>
  <li>phone numbers  </li>
  <li>selected campaigns  </li>
  <li>selected templates  </li>
  <li>selected contacts  </li>
  <li>selected groups  </li>
  <li>and about 2-4 information types more</li>
  </ul>
  
  <p>Before refactoring there were all this parameters were passed through constructor to the Counter class(8 parameters, you can image that..).</p>
  
  <p>To increase readability I have introduced a Data class, named CostCountingData with readable getters and setters to all this properties.</p>
  
  <p>But I don't think, that that code became much readable after this refactoring:</p>
  
  <pre><code>$cost_data = new CostCountingData();
  $cost_data-&gt;setNumbers($numbers);
  $cost_data-&gt;setContacts($contacts);
  $cost_data-&gt;setGroups($groups);
  $cost_data-&gt;setCampaigns($campaigns);
  $cost_data-&gt;setUser($user);
  $cost_data-&gt;setText($text);
  $cost_data-&gt;setTotalQuantity($total_quantity);
  
  $CostCounter = new TemplateReccurentSendingCostCounter($cost_data);  
  $total_cost = $CostCounter-&gt;count();
  </code></pre>
  
  <p>Can you tell me whether there is some problem with readability of this code snippet?
  Maybe you can see any code smells and can point me at them..</p>
  
  <p>The only idea I have how to refactore this code, is to split this big data object to several, consisting related data types. But I'm not sure whether should I do this or not..</p>
  
  <p>Whay do you think about it?</p>