Matt
Matt

Reputation: 2843

DDD Specification pattern - where do they belong?

I have an array of Users and I need to know if the array contains only one User and if so, is that User a super user. For this, I think a Specification (isSatisifedBy) is perfect for this, however, where in my application should I save these files? in the bounded context under a Specification folder?

Thanks in advance

Upvotes: 0

Views: 2235

Answers (1)

Mik378
Mik378

Reputation: 22171

See this example made by Eric Evans in his famous book on DDD.

A specification is part of the domain model, so there should live in the same package of the model, so of course in the same bounded context.
In this example, Cargo is the model and RouteSpecification is one of its specification.

Upvotes: 4

Related Questions