title: How to pass the various input parameters to a method in a class efficiently?
body: <p>Below is my Interface - </p>
  
  <pre><code>public interface IClient {
      public String executeSync(ClientInput input);
  }
  </code></pre>
  
  <p>This is my Implementation of the Interface - </p>
  
  <pre><code>public class TestingClient implements IClient {
  
      @Override
      public String executeSync(ClientInput input) {
  
      }
  }
  </code></pre>
  
  <p>Now I have a factory which gets the instance of <code>TestingClient</code> like this - </p>
  
  <pre><code>IClient client = TestingClientFactory.getInstance();
  </code></pre>
  
  <p>Now customer is going to make a call to <code>executeSync</code> method of my <code>TestingClient</code> which accepts the <code>ClientInput</code> parameter and below is the class for the <code>ClientInput</code>.</p>
  
  <pre><code>public final class ClientInput {
  
      private Long userid;
      private Long clientid;
      private Long timeout = 20L;
      private boolean debug;
      private Map&lt;String, String&gt; parameterMap;
  
      public ClientInput(Long userid, Long clientid, Map&lt;String, String&gt; parameterMap, Long timeout, boolean debug) {
          this.userid = userid;
          this.clientid = clientid;
          this.parameterMap = parameterMap;
          this.timeout = timeout;
          this.debug = debug;
      }
  
   ... //getters here
  }    
  </code></pre>
  
  <p>So when customer make a call to <code>executeSync</code> method of our <code>TestingClient</code>, they will create the <code>ClientInput</code> parameter like this and then use the factory to get the Instance of <code>TestingClient</code> and then call the executeSync method accordingly.</p>
  
  <pre><code>Map&lt;String, String&gt; paramMap = new HashMap&lt;String, String&gt;();
  paramMap.put("attribute", "segmentation");
  
  ClientInput input = new ClientInput(109739281L, 20L, paramMap, 1000L, true);
  
  IClient client = TestingClientFactory.getInstance();
  client.executeSync(input);
  </code></pre>
  
  <p><strong>Problem Statement:-</strong></p>
  
  <ol>
  <li>Is this the right way to make <code>ClientInput</code> parameters and pass to <code>executeSync</code> method as shown above?</li>
  <li>There are already three arguments of the Long type in my ClientInput it may not be clear to other developers which position is for which field (especially during those long nights...). Any thoughts how to avoid this?    </li>
  <li>If more inputs are required, it will make the constructor declaration longer. How can I overcome this situation?</li>
  </ol>