August 2017
Beginner
298 pages
7h 26m
English
While reading about optional module dependencies, a thought might have occurred to you--how about using services? We've learned in Chapter 7, Introducing Services, about how using services in Java modules provides a flexible and loosely coupled way of having modules work with each other. With services, you don't have to specify a readability relationship with requires. Modules that provide services are optional, not just in runtime, but also during compile time! So aren't services already better than optional dependencies?
The simple answer is yes. Services are definitely the preferred way of decoupling modules and removing hard dependencies. This is what we'll examine in this pattern. However, ...
Read now
Unlock full access