title: Java package politics
body: <p>I always doubt when creating packages, I want to take advantage of the package limited access but at the same time I want to have similar classes divided into packages.
  The problem comes when you understand that packages are not hierarchical in Java:</p>
  
  <blockquote>
    <p>At first, packages appear to be
    hierarchical, but they are not.
    <a href="http://download.oracle.com/javase/tutorial/java/package/usepkgs.html" rel="nofollow">source</a></p>
  </blockquote>
  
  <p>Imagine I have an API defined with its classes at foo.bar, only the classes the API client needs are set public. Then I have another package with some internal objects I need in the API defined at foo.bar.pojos, this classes need to be public so they can be accessed by foo.bar but this means the API client could also access them if the package foo.bar.pojos is imported.</p>
  
  <p>What is the common package politic that should be followed?</p>