Questions tagged [ddd-service]
90 questions
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…

Pedro L
- 164
- 2
- 6
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…

George
- 3,757
- 9
- 51
- 86
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,315
- 2
- 14
- 38
3
votes
2 answers
How to define an entity with translations using DDD
I have a small application using Domain Driven Design and now I would like to have an entity with translations.
I have read on the internet that the best practices in Domain Driven Design is to separate the translations from the model but I don't…

Jorge
- 73
- 1
- 9
3
votes
2 answers
Implementing user-defined business rules with DDD
Let's say If I have an application which let's user create business rules to be applied on a domain entity. A rule can be a combination of a condition and multiple actions where if condition evaluates to true then corresponding actions are executed.…

Syed Danish
- 106
- 1
- 9
3
votes
1 answer
Identifier vs. Reference in DDD
I've got two cases where I can use whether an id of an Entity or pass it as reference.
1) Domain Services. Example:
class ProductService {
public void changePrice(Product product, long newPrice) {
// significant calculations involving…

Alexey Balchunas
- 400
- 3
- 10
3
votes
2 answers
Where to keep the common services?
In Domain Driven Approach - Where to keep the common services?
Eg., Sometimes we may need to have common functions like getcountrylist, getstatelist, getcitylist, (or some other data from MASTER tables) to show the dropdown in the different…

user3767551
- 69
- 7
3
votes
1 answer
DDD - Entity's repository dependent validations
I'm having a hard time trying to figure out the best way to implement business rules validation that depend on data stored in the database. In the simplified example bellow, I want to ensure the Username attribute is unique.
public class User() {
…

otaviosoares
- 566
- 7
- 17
3
votes
1 answer
Factories, services, repository in DDD
I have some questions regarding factories, repositories and services in DDD. I have the following entities: Folder, file, FileData.
In my opinion the "Folder" is an aggregate root and should have the responsibility of creating the File and FileData…

John
- 95
- 1
- 7
2
votes
4 answers
PHP & DDD: How to ensure that only a Service can call a method on an entity?
I'm working with a domain model, in which I have a Reservation class:
class Reservation
{
public function changeStatus($status) { ... }
}
Because the changeStatus() method should only be called in a context where all appropriate notifications…

BenMorel
- 34,448
- 50
- 182
- 322
2
votes
3 answers
How to construct domain model from persistence store? #DDD
I am trying to learn domain-driven design (DDD). And I don't understand how to construct domain model from the persistence store. I am making my domain models without public setters in order to keep my states safe and consistent, but ,on the other…

Uuganbold Tsegmed
- 58
- 6
2
votes
4 answers
DDD: what methods should entity contain?
I have class that represents user authorization (scala code):
case class Authorization(
userId: UUID,
permissions: Seq[String],
userRoles: Seq[String],
…

GoodPerson
- 141
- 2
- 6
2
votes
3 answers
DDD design understanding
I've been starting to learn about DDD and I have couple of questions so that I can improve my understanding of it.
So a typical DDD architecture looks like this
Domain Layer => this layer should be technology agnostic and should contain the…
user9124444
2
votes
3 answers
Entity Framework and DDD - Load required related data before passing entity to business layer
Let's say you have a domain object:
class ArgumentEntity
{
public int Id { get; set; }
public List AnotherEntities { get; set; }
}
And you have ASP.NET Web API controller to deal with it:
[HttpPost("{id}")]
public…

Philipp Bocharov
- 197
- 1
- 13
2
votes
1 answer
DDD, external datas and Repository
I'm thinking to use DDD for our next application. I have already found a lot of interesting papers and answers but cannot find a solution to my problem :
We have an SOA. architecture where some services are known as master of their datas. That's…

gervais.b
- 2,294
- 2
- 22
- 46