title: Is it good practice to develop a helper network class that is responsible for all network tasks?
body: <p>I have created the following class:</p>
  
  <pre><code>public class AsyncHttpsClientHelper {
  
  public static final int REMOVE_CREDIT_CARD = 1;
  public static final int ENABLE_AUTORENEW = 2;
  // +10 final ints...
  
  private static AsyncHttpsClientHelper instance = null;
  private static Activity activity;
  // Some other variables
  
      private AsyncHttpsClientHelper(Context context) {
          // Initiate variables
      }
  
      public static AsyncHttpsClientHelper getInstance(Context context) {
          // Guarantees the same instance for this class (Singleton)
      }
  
      public void performNetworkTask(int networkTaskType, String value)
      {
          switch (networkTaskType)
          {
              case REMOVE_CREDIT_CARD:
              {
                  CupsLog.d(TAG, "path: " + Consts.ACCOUNT_REMOVE_CREDIT_CARD_PATH);
                  client.post(Consts.ACCOUNT_REMOVE_CREDIT_CARD_PATH , new JsonHttpResponseHandler() {
  
                   @Override
                   public void onSuccess(JSONObject result) {
                  try {
                      CupsLog.d(TAG, Consts.ACCOUNT_REMOVE_CREDIT_CARD_PATH + " -&gt; onSuccess, result: " + result.toString(3));
                      AccountService.getInstance(activity).pullAccountDetailsFromServer();
                      Toast.makeText(activity, "Your credit card was removed", Toast.LENGTH_SHORT).show();
                  } catch (JSONException e) {
                      e.printStackTrace();
                  }
              }
  
                   @Override
                   public void onFailure(Throwable arg0) {
                      CupsLog.d(TAG, "commitPaymentToServer -&gt; onFailure");
                       BusProvider.getInstance().post(new DialogChangeEvent(DialogChangeEvent.REMOVE_CREDIT_CARD, "failed"));
                  }
          });
          break;
              }
              case ENABLE_AUTORENEW:
              {
                  // Do ENABLE_AUTORENEW logic
              }
              // +10 cases goes here...
          }
      }
  }
  </code></pre>
  
  <p>This class is not finished yet and I still have to add here another 10 other network calls I perform all around the application.</p>
  
  <p>To run one of the network tasks I run this line for example:</p>
  
  <pre><code>AsyncHttpsClientHelper.getInstance(this).performNetworkTask(AsyncHttpsClientHelper.COMMIT_COUPON_TO_SERVER, event.getValue());
  </code></pre>
  
  <p>When the task finishes I fire an <code>Event</code> using the <code>Square</code> event <code>Bus</code> tool to commit the needed visual changes to the activity/ fragment layout.</p>
  
  <p><strong>The Question:</strong> My boss claims that this is a bad practice and that this class will become a mess when I finish it. More over he claims that this class should be a stupid class that all he knows how to do is to configure the <code>AsyncHttpClient</code> object and return it so I could use it and perform the https tasks inside the relevant <code>Activity</code>. Basically he says the the https calls themselves should be located in the Activity classes. I like this way better and think it makes my activities more cleaner and nicer to read. He on the other hand says that this way its harder to debug and that this class combines a part of Controller and View functionality which it should not do. </p>
  
  <p>So who is right? is it really a bad practice to create a class like this?</p>