Is Separated Interface a Necessity?

Since this AuthenticationService does not have a technical implementation, is it really necessary to create a Separated Interface and implementation class, and in separate Layers and Modules? No, it is not, in fact, an absolute necessity. We could have created this particular Service with only a single implementation class with the name of the Service:

package com.saasovation.identityaccess.domain.model.identity; public class AuthenticationService {     public AuthenticationService() {         super();     }     public UserDescriptor authenticate(             TenantId aTenantId,             String aUsername,             String aPassword) {         ...     } }

There would be ...

Get Implementing Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.