Now that the entity classes have been defined, it's time to turn our attention to the domain service classes. As we mentioned earlier in this book, in conjunction with the Sweets Complete web application, domain service classes allow us to connect to the database. They contain methods that are useful for adding, editing, deleting, or querying the various MongoDB collections that have been defined.
Accordingly, as we have determined four primary collections for the Book Someplace web application, we will define four domain service classes. For illustration purposes, we'll discuss how to define a domain service class associated with the Customers collection.