Questions tagged [ddd-service]

75 questions
10
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,375
  • 2
  • 15
  • 18
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…
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…
6
votes
1 answer

DDD: is it ok to inject a Service into an Entity

I have a tree of Zone objects: class Zone { protected $parent; public function __construct(Zone $parent) { $this->parent = $parent; } } There are no children nor descendants property in the Zone, because I want to avoid the…
BenMorel
  • 30,280
  • 40
  • 163
  • 285
6
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…
James Okpe George
  • 3,047
  • 7
  • 42
  • 76
6
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,245
  • 6
  • 36
  • 97
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
  • 42,736
  • 37
  • 154
  • 239
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…
4
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…
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
  • 3,790
  • 4
  • 31
  • 59
3
votes
2 answers

DDD Accessing an Entity by an indirect parent Entity Id

I am building an app that integrates Plaid API to access user bank info (logins, accounts, transactions, etc.). I'm trying to follow DDD principles. Here is a general idea of how the Plaid API flow works: A user provides his email/password for some…
3
votes
1 answer

DDD Domain Entity vs Persistence Entity

In DDD we say that the domain Entity is not a representation of the database model/entity. We also say that to correctly extract the domain model from the application, the domain model is not supposed to have any information about the way it is…
3
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…
3
votes
3 answers

PHP DDD how to name entry point method?

What should be the best practice in php to name an entry point method in a service when following DDD design principles. Same as class: class GetSinglePerson { ... public function getSinglePerson($personId) { } } Command…
peterpeterson
  • 1,182
  • 2
  • 12
  • 34
3
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
  • 2,783
  • 4
  • 24
  • 45
1
2 3 4 5