0

Let's say a project has an application layer and a domain layer.

AFAIK services implemented in the application layer execute use cases.

The methods defined in the services often contain ubiquitous language. Do the interfaces of these services belong in the application layer or the domain layer?

asked Feb 6 at 7:54
1
  • Why do these interfaces exist? Place them in the most ‘inner’ layer where you use them. Also, the ubiquitous language should not only exist in the domain layer, but everywhere in your bounded context. It doesn’t make sense not to use the ubiquitous language in API controllers, application services, database tables, etc. Commented Feb 6 at 18:34

1 Answer 1

3

The most principled place for such an interface would be in its own abstractions library along with any models specific to the service.

However. This can end up with a million libraries each containing only one interface. It's not very practical when you probably only use the service in one application and never make other interface implementations.

Unless you are publishing to the world I would either just have the interface in the same library as the service. OR consider it part of the domain and put it with the domain models

answered Feb 6 at 8:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.