Open cer opened 4 years ago
Hi Chris,
I have some questions regarding to previous implementation of api-modules:
"Each service has a *-api module" - why ftgo-order-history-service and ftgo-restaurant-service-aws-lambda didn't have these api-modules? Why ftgo-api-gateway didn't have this api? (Does it make sense at all for ftgo-api-gateway to have its own api-module? I guess not, but it would be good to understand, why).
in Order Service - why some events were placed in api-module (OrderCreatedEvent, OrderDomainEvent) and some events were placed in the Order Service itself (OrderCancelled, OrderRevised, OrderAuthorizedCancelRequested). Is there some rule for placing event to api-module or to service itself?
in Order Service api-module - why there are some DTOs/POJOs there (like OrderLineItem, OrderDetails)? Is there some rule for placing these DTOs/POJOs in api-module and not in the service itself?
Thanks, Andrew
Each service has a
*-api
module that contains Java classes forThis approach has several drawbacks:
A better approach is for
*-api
module to contain OpenAPI and JSON Schema definitions. Each service can contain tests that verify API conformance. Each consumers can codegen the needed classes.