title: Is business logic in constructors a good idea?
body: <p>I'm currently rebuilding a specialised ticket system at work (mainly used to support people with faults in remote sensing hardware...). Anyway, I was wondering whether doing lots of workflow type activity in an object's constructor is a good idea.</p>
  
  <p>For example, there is currently this:</p>
  
  <pre><code>$ticket = new SupportTicket(
      $customer,
      $title,
      $start_ticket_now,
      $mail_customer
  );
  </code></pre>
  
  <p>as soon as the object is created, it'll put a row into a database, go and mail the customer a confirmation e-mail, possibly send a text message to the nearest technician, etc..</p>
  
  <p>Should a constructor be firing off all that work, or something more like the following?</p>
  
  <pre><code>$ticket = new SupportTicket($customer, $title);
  $customer-&gt;confirmTicketMailed($ticket);
  $helpdesk-&gt;alertNewTicket($ticket);
  </code></pre>
  
  <p>If it helps, the objects are all based on the ActiveRecord style.</p>
  
  <p>I guess it may be a matter of opinion, but what do you think is the best thing to do?</p>