title: Java API Design - Internal Design
body: <p>I'm making my first API that gets data and parses it from websites. So there is a lot of network and parsing in it. I read about API's having an internal packages in which shouldn't be public; like in Javadocs. So my question is what should and shouldn't be put in the internal package. Here is my package design, I'm leaving out the non important ones.</p>
  
  <pre><code>.networkstats
  .networkstats.model
  .networkstats.parser
  </code></pre>
  
  <p>Inside <code>networkstats</code> package there is a class called <code>NetworkStats</code>. That is the main class that handles and retrieves all of the network connections. It then uses the classes inside the <code>parser</code> package to process the data. After it returns a Model class that holds the data inside the <code>model</code> package. I want to include the internal package because there will be some classes and interfaces that aren't meant to be used by the users. </p>
  
  <p>For example I want to make a class the handles all of the network connections so the other classes like <code>NetworkStats</code> can access it. Reason I want to do that is because I don't want to copy the code in other classes when It can be in one place. Of course I don't want other users using this class so I would put it in the internal package? I would also put my <code>parser</code> package in the internal one too. So my main question is that do you put classes and interfaces that aren't meant to be used in the public in the internal package? I know they <em>can</em> still access it.</p>
  
  <pre><code>.networkStats.internal.DataManager // class that handles network connections
  .networkStats.internal.parser
  </code></pre>