O'Reilly logo

Implementing Domain-Driven Design by Vaughn Vernon

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

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 ...

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