Questions tagged [ddd-service]
90 questions
14
votes
2 answers
DDD - Where should third-party API interfaces should be?
If we consider a standard persistence repository, the solution is easy. We put the IStuffRepository in the Domain Layer, and the StuffRepositoryImplementation in the Infrastructure Layer.
But what is the good pattern when we want to wrap a…

Normand Bedard
- 2,625
- 2
- 19
- 22
10
votes
4 answers
DDD: where should logic go that tests the existence of an entity?
I am in the process of refactoring an application and am trying to figure out where certain logic should fit. For example, during the registration process I have to check if a user exists based upon their email address. As this requires testing if…

user1790300
- 2,143
- 10
- 54
- 123
9
votes
1 answer
DDD Application Service Domain Model to View Model Mapping
My understanding of the application services are that they link between the domain and the user interface together. In other words, they serve the controller to perform operations on the domain.
I have the following project layout in my…

Shane van Wyk
- 1,870
- 1
- 26
- 62
8
votes
2 answers
How to Combine Data From Different Bounded Context in DDD
Example:
I have two bounded contexts Exams and Courses. The Exams context has a Student entity that has information about the students to take an exam. And the Courses context has a teachers entity that contains information about the teacher…

George
- 3,757
- 9
- 51
- 86
7
votes
1 answer
DDD: is it ok to inject a Service into an Entity
I have a tree of Zone objects:
class Zone {
protected Zone $parent;
public function __construct(Zone $parent) {
$this->parent = $parent;
}
}
There are no children nor descendants property in the Zone, because I want to avoid…

BenMorel
- 34,448
- 50
- 182
- 322
7
votes
3 answers
how to implement services and repositories on onion architecture?
I've been studying onion architecture for a couple of days. I understand that dependencies should always go toward the center and how to use dependency injection to accomplish this. But I have a couple of questions I still couldn't figure out.
Can…

Saulo Vallory
- 959
- 9
- 32
6
votes
2 answers
DDD domain services: what should a service class contain?
In Domain Driven Design, domain services should contain operations that do not naturally belong inside an entity.
I've had the habit to create one service per entity and group some methods inside it (Organization entity and OrganizationService…

Matthieu Napoli
- 48,448
- 45
- 173
- 261
5
votes
2 answers
Is there any concept in DDD about shared value objects
I need to know about how to use shared value objects in DDD Eg?
If i have two aggregates roots called Registration and Admission, both this aggregates consuming a value object called Address. even though my ubiquitous language are different…

Binson Eldhose
- 993
- 3
- 14
- 35
5
votes
2 answers
Connecting the dots with DDD
I have read Evans, Nilsson and McCarthy, amongst others, and understand the concepts and reasoning behind a domain driven design; however, I'm finding it difficult to put all of these together in a real-world application. The lack of complete…

jpm70
- 51
- 2
4
votes
1 answer
DDD, Domain Services and Events
Situation:
To work with domain events, Jimmy Bogart proposed a method for storing events in aggregates.
This, from my point of view, is a very convenient approach. However, what about the case of a domain event in the domain service?
Domain Service…

Eladei
- 151
- 1
- 4
4
votes
4 answers
Duplicate business logic in front-end with ddd microservice back-end
Here's an abstract question with real world implications.
I have two microservices; let's call them the CreditCardsService and the SubscriptionsService.
I also have a SPA that is supposed to use the SubscriptionsService so that customers can…

gislikonrad
- 3,401
- 2
- 22
- 24
4
votes
2 answers
Use Case to Command / Application Layer Mapping: Implementation
Some texts I've read regarding DDD indicate that an Application Service or a Command (CQRS) in the Application Layer closely mirrors a specific Use Case.
For simple use cases, this mapping makes sense, but in more complicated instances that require…

Steven
- 823
- 8
- 25
4
votes
1 answer
Is this domain or application service
I am building authentication micro-service/domain by using DDD and I am still having trouble with identifying where does each service belong. At this point I am not sure does Authentication service belongs to the domain services or application…

Robert
- 3,353
- 4
- 32
- 50
4
votes
1 answer
Separate application service for command / query in CQRS implementation in Domain Driven Design?
When implementing CQRS with Domain Driven Design, we separate our command interface from our query interface.
My understanding is that at the domain level this reduces complexity significantly (especially when using event sourcing) in the domain…

drizzie
- 3,351
- 2
- 27
- 32
3
votes
2 answers
Another application architecture question
I am trying some DDD and I will try to describe in most simple manner what I have done.
Core project
The core project contains Entities, VO and domain services. For example I have User entity and UserRelation entity. I think we all know what is the…

mynkow
- 4,408
- 4
- 38
- 65