The state of API encapsulation
To best explain the situation (and associated problems) with API encapsulation, all we need to do is recall from Chapter 1, Introducing Java 9 Modularity, Jack's trouble with his sorting library. He had an internal public class in his library that wasn't meant for external use, but it did end up getting used. If such a small library with the meagerly count of two classes could run into this problem, imagine the situation with the Java runtime with thousands of classes! The Java language provides documented APIs for developers to use. But it also has many supporting classes to facilitate the inner workings of those APIs that shouldn't be used by developers. However, surely enough, they are all a part of the sole ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access