title: Single Responsibility Principle Refactor
body: <p>I have some code I'd like to re-factor so it does not violate Single Responsibility Principle (SRP).  </p>
  
  <p>I understand that the below class could change for multiple reasons:</p>
  
  <ul>
  <li>Business rules for analyze could change</li>
  <li>Metadata schema could change</li>
  <li>Upload method could change</li>
  </ul>
  
  <p>However, I'm having a tough time figuring out how I can re-factor into separate classes.</p>
  
  <p>Engine.java</p>
  
  <pre><code>package com.example;
  
  import java.util.List;
  
  public interface Engine {
    public List&lt;Recording&gt; analyze(List&lt;String&gt; files);
    public List&lt;Recording&gt; getMetadata(List&lt;Recording&gt; recordings);
    public List&lt;Recording&gt; upload(List&lt;Recording&gt; recordings);
  }
  </code></pre>
  
  <p>CallEngine.java</p>
  
  <pre><code>package com.example;
  
  import java.util.ArrayList;
  import java.util.List;
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
  public class CallEngine implements Engine {
  
    final static Logger log = LoggerFactory.getLogger(Main.class);
  
    public List&lt;Recording&gt; analyze(List&lt;String&gt; files) {
      log.info("Analyzing recording files per business rules...");
  
      List&lt;Recording&gt; recordings = new ArrayList&lt;Recording&gt;();
      return recordings;
    }
  
    public List&lt;Recording&gt; getMetadata(List&lt;Recording&gt; r) {
      log.info("Retrieving metadata for calls...");
      List&lt;Recording&gt; recordings = new ArrayList&lt;Recording&gt;();
      return recordings;
    }
  
    public List&lt;Recording&gt; upload(List&lt;Recording&gt; r) {
      log.info("Uploading calls...");
      List&lt;Recording&gt; recordings = new ArrayList&lt;Recording&gt;();
      return recordings;
    }
  }
  </code></pre>