title: 'Friends' equivalent for Java?
body: <p>having a little architectural trouble here.</p>
  
  <p>In C++, we have the notion of 'friends,' where such friend classes can access private members.</p>
  
  <p>So, I'm deving a Java app and trying to adhere to the MVC architecture. I've got a controller class that manages graph connectivity between 'map_objects.' I'd like to hide the function in the DTO 'map_objects' that actuall sets up these connectivities, by using this controller class.</p>
  
  <p>(Ie, even if the controller class implements the required functionality of setting up connectivities, the 'users' can still access setter/getter functions in the the DTO directly to set them up themselves.)</p>
  
  <p>Are there any design patterns or tips in this regard?
  (Or have I totally mucked up?) </p>
  
  <p><strong><em>DUPLICATE</em></strong> <a href="https://stackoverflow.com/questions/182278/is-there-a-way-to-simulate-the-c-friend-concept-in-java">Is there a way to simulate the C++ &#39;friend&#39; concept in Java?</a></p>