Decoupled Service Output

A couple of times earlier I discussed the use of Data Transformers as a way to accommodate disparate client types with the specific data type they require. That approach uses Transformers to produce the data in a specific type that implements an abstract interface that all related types share. Again, from the client’s perspective it might look like this:

TenantData tenantData =     tenantIdentityService.provisionTenant(             ..., myTenantDataTransformer); TenantPresentationModel tenantPresentationModel =     new TenantPresentationModel(tenantData.value());

The Application Services are designed as an API, with input and output. The reason for passing in a Data Transformer is to produce ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.