I can only repeat myself: I agree that there are more complex use cases, but I don't consider them relevant in the scope of the book's
ResourceHolder. I don't see where we would benefit from a larger API.
That's what I meant with "An
exists() method provokes a different design: Users don't have a clear owner and scope of the resource anymore." Instead of requiring the resource to be loaded before it's used, users are then allowed to query for the availability, which leads to a different usage pattern. They start to load resources in multiple places, differentiate cases and use delayed loading. This however works against the original ideas (for example centralized loading, simplest possible usage, clear ownership).
When talking about design, you really have to keep in mind that we're not presenting the ultimate solution, but trying to find a good tradeoff between simplicity, flexibility, and suitability to teach new concepts. Those of you who have the book, please read the section "A typical use case", it explains the reasoning which led to the
ResourceHolder API as it is now. Keep also in mind that we emphasize multiple times that the reader should not see himself limited by the basis we provide; it is always possible to extend the given code