O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Getting ready

There is nothing specific we need to set up for this recipe. In this recipe, we will take a simple example. We have one BookService abstract class which supports CRUD operations. Now, these CRUD operations can work on a SQL DB or on MongoDB or on file system and so on. This flexibility can be provided by using service provider interface and ServiceLoader class to load the required service provider implementation. 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required