Modeling a Service in the Domain

Depending on the purpose of a Domain Service, it can be quite simple to model. You’ll have to decide whether or not your Service should have a Separated Interface [Fowler, P of EAA]. If so, this might be the interface definition:

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

The interface is declared in the same Module (9) as the identity-specific Aggregates, such as Tenant, User, and Group. That is done because AuthenticationService is an identity concept, and we currently place all identity-related ...

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.