Questions tagged [domain-driven-design]
Domain-driven design (DDD) is an approach to develop software for complex needs by connecting the implementation to an evolving model.
1,572
questions
0
votes
0
answers
40
views
How many domain models should I have? [duplicate]
Let's say I'm developing a simple blog and decided to use DDD.
Is it ok to have root aggregate called Posts which uses Posts abstract repository implementation of which can save both Posts and Tags(...
0
votes
1
answer
55
views
DDD On Large Scale Applications
Working on DDD lately got me thinking about how it preforms on large scale systems.
Watching many tutorials and reading many articles makes it look fun and promising for small projects.
I have three ...
-4
votes
1
answer
168
views
I do not like RESTful APIs anymore and dont understand why nobody agrees with me [closed]
Some years ago, every API I developed was a REST API and I did everything to follow the best practices to make them "RESTful".
But after some time, I have my doubts if RESTful APIs that ...
0
votes
1
answer
39
views
Where to store a props type declaration on a DDD project?
I am trying to apply DDD to a Vue project (so it's DDD on the frontend) and I have a doubt as to where store a props type. A Vue component can have props, which is basically named data passed to the ...
0
votes
2
answers
184
views
Clean Architecture: Loading data for the domain layer
Let's say my domain has a User Entity that has a many to many relationship with itself representing "Friends"
public class User
{
public int Id;
public IEnumerable<User>? ...
1
vote
1
answer
135
views
Console application vs. logger
I'm making a console application that returns a lot of information directly to the console. I do this with a custom logger. Actually my logger implementation is just a frontend to print (with some ...
0
votes
2
answers
82
views
Where to put factories that depend on the application layer?
I am a frontend developer (currently working with Vue and TS), and I have been searching for better organization of the frontend code and recently I got to know DDD a bit. I know DDD is mostly used ...
0
votes
2
answers
112
views
Domain Services vs Repositories when backed by a remote service
I'm building a DDD application which is effectively a wrapper around Cognito. As such, everything that this is doing is effectively just a call onto the Cognito SDK.
Where I'm getting confused is how ...
0
votes
2
answers
67
views
How to structure a cart with cart products object
I am new to DDD and I am having trouble structuring an object. I have a cart, where I can add products to it. Each product has some properties like image, title, price, etc. Whenever a product is ...
3
votes
6
answers
446
views
Marketing team's term for ubiquitous language
We are working on a ubiquitous language; however, there are different terms used for marketing purpose and one used for product team and engineering team. The marketing team's term is more for PR ...
0
votes
4
answers
198
views
The role of the Product Owner in a Scrum Team following Domain-Driven Design
In the Scrum framework, the Product Owner is the person responsible for preparing the backlog, refining it, and prioritizing it. He/she is expected to be a domain expert and somebody with enough ...
1
vote
1
answer
117
views
How large and thorough should the domain layer be?
TL;DR: Should the domain layer span the entire breadth of the app such that everything can be simulated, from point A to point Z, or may the application layer be used as the orchestrator and serve as ...
-1
votes
0
answers
61
views
Design of Complex Java Filters
I have a collection of DTOs and would like to filter the collection on a complex set of criteria. For example:
//modelIds is a Collection<String>
cars
.stream()
.filter(car -> {
modelIds ==...
1
vote
5
answers
299
views
Specialization and LSP violation?
I have Document and ExternalDocument classes in my system, where ExternalDocument extends Document. The main distinction is that ExternalDocument holds onto externalDocumentId and externalEventId data ...
1
vote
3
answers
674
views
Should the Use Case be responsible for transforming its primitive parameters into typed data for the Entity to use?
I'm building a Use Case for creating blog posts, this Use Case has its own "DTO", which is basically a parameter object with only primitive data, as follows:
Use Case's DTO (Parameter Object)...
-1
votes
1
answer
94
views
How to integrate business logic from Domain layer with UI
I have a rich client with quite complex domain logic and I want to keep the domain and presentation layer separated. How would you advice to intergrate the domain logic with the UI in this case.
I ...
3
votes
3
answers
1k
views
Define multiple DDD events or just one XXXChanged event when using CQRS?
Is it preferable to define a single 'container event' like below:
trait UserStatus
case object Active extends UserStatus
case object Inactive extends UserStatus
case class UserStatusChanged(...
1
vote
1
answer
87
views
Where to perform conditional mapping in Domain Driven Design?
How can I do conditional mapping in Domain Driven Design?
Let's say my application is structured like this:
- Core
- Domain
- Application
- Presentation
- DTOs
- API
I have an aggregate root ...
10
votes
3
answers
2k
views
Balance between aggregate boundaries and domain consistency in DDD
Designing an Aggregate and choosing an Aggregate Root getting tricky for me all the time especially when it comes to ensuring right transactional contexts and consistency constraints so I'm wondering ...
0
votes
2
answers
3k
views
Object Oriented Analysis and Design and DDD together
I fear this question seems too broad, so I'll try to explain what I mean with some detail. I couldn't, however, find a way to divide it into other questions. If that's really the case, I will gladly ...
7
votes
1
answer
713
views
How to achieve both: clean (hexagonal) architecture with JPA goodies?
How do I achieve two things at the same time writing Java Spring Application:
Clean Architecture
JPA goodies (@Transactional, Optimistic Locking, dirty checking, etc.)
I like the idea of database/...
0
votes
0
answers
44
views
Domain-Driven Design: Storage layer and MySQL client
I'm very new in DDD and I was following one of the videos of GohperCon to structure of my Golang App using DDD with Hexagonal Architecture. At the lowest (deepest) layer is the storage that can be ...
4
votes
1
answer
892
views
DDD / Onion architecture in JavaScript
One reason I like .NET is because the 'solutions' and 'projects' lends themselves to good architecture.
Good architecture makes it easy to follow the happy path of Domain-Driven Design.
I've fallen ...
0
votes
1
answer
58
views
Domain Boundary Definition in `proximity service` as a Case Study
While practicing System Design, I decided to create a hypothetical proximity service (like Google Maps) with a microservice architecture. Suppose we have 3 core categories of functionality:
CRUD ...
0
votes
0
answers
43
views
How to handle multiple-state domain object?
Let's take an example of Order.
An order can have the state new, canceled, shipped, or processing.
The new order can be processed.
The new order can be canceled.
The processing order can be shipped.
...
0
votes
1
answer
493
views
Identifying Bounded Context in Task Management
I am currently trying out DDD with a sample application, "Task Management System". This is not related to any specific domain as such, it will be a generic application which can be used in ...
1
vote
2
answers
162
views
In DDD, how can repositories be optional?
I was reading the infrastructure persistence layer design documentation, and this quote has me confused:
This'll probably be my biggest feedback. I'm really not a fan of repositories, mainly because ...
2
votes
2
answers
604
views
Should I handle all nine comparisons?
I was reading this article here: http://enterprisecraftsmanship.com/2014/11/08/domain-object-base-class/. The article talks about creating a base Entity class, which handles four of the nine ways to ...
0
votes
2
answers
257
views
Deserializing/Serializing a cached domain object breaks DDD principles
My application has to maintain a stateful object and update it periodically based on events received. I get an initial HTTP request to create this stateful object. After that the object has to be ...
4
votes
2
answers
555
views
How far to go when decoupling Microservices by use of Integration Events (Messages)?
I am reading the architecture guide from the .net core project. They state:
The integration events can be defined at the application level of each microservice, so they are decoupled from other ...
0
votes
1
answer
200
views
Validation in a simple DDD example
I'm doing a simple project that represents a CI Pipeline in a low scale. So I'm trying to model "the best way possible" to practice DDD.
Basically I have the following information:
...
-1
votes
1
answer
55
views
Map a domain object from a third party application or a different bounded context
I'm tasked with developing an application which is going to track what an end user does in a session.
My application doesn't handle user registration or anything related to user. The user management ...
4
votes
1
answer
737
views
Posts and Comments - how should I define them in domain driven design?
I am designing a blog in domain driven design. I don't know how I should define models: Post and Comment.
My database:
A user can see a post and related comments. So I think that Post model can be ...
1
vote
2
answers
133
views
Placing business logic on a not so small/big project
I am having a bit of problem trying to find the correct place for business logic. The project I am working on isn't huge, but is not small either and has a very considerable importance in my company. ...
1
vote
2
answers
124
views
DDD - Entity model duplication vs Referencing the Entity Id in different bounded contexts
Asume these two bounded contexts:
Book Management: manages the creation of books and its attributes:
Book(id, name, author, summary, ISBN, length, cover photo)
Book Order: creates orders related to ...
0
votes
1
answer
65
views
Communicating unpredicted Failure from Repository implementation to Applicaiton Layer
My application follows Clean Architecture wherein the Application Layer wraps the Domain Layer. I try to adhere to DDD more-so as a "guiding light" than a strict rulebook.
Within the Domain ...
1
vote
2
answers
945
views
How to design an API wrapper with bulky operations on domain object? (Need guidance)
I need some guidance in designing an API wrapper for my backend APIs. I have tried to keep it as specific as possible.
Context: We have a project which supports certain file operations like edit, ...
4
votes
3
answers
1k
views
Can two different kind of aggregates in Domain Driven Design have actually the same unique Id?
Assume that we are doing aggregate design for a ride hailing application and we have created the following aggregates: DriverAvailability aggregate, which has a value object containing the status (...
2
votes
1
answer
270
views
How to restrict the construction of a domain object to an external service?
I have this object
RelativeFoo{int relativeCode, Origin relativeTo}
And I want to map it to this other object
AbsoluteFoo{int absoluteCode}
In order to do this, I need to use a service whose ...
1
vote
1
answer
359
views
DDD access to a composite Aggregate across Boundary Contexts
The behavior of my systems is as follows
user places an order for a product
1a. order management creates a placeholder record for the order
1b. forwards the order to an external vendor.
external ...
1
vote
1
answer
2k
views
DDD Including DB Id in domain entity
According to the book, The domain layer should be isolated. In domain entity, you should avoid adding a property represents database PK (usually identity surrogate column called ID).
There is no ...
0
votes
4
answers
2k
views
Should an MVP/MVC Model contain behaviour?
I have read plenty of questions on here, which appear to confuse the MVP/MVC Model with the Domain Model. In my mind the MVP Model calls the Service, which then calls a rich Domain Model i.e. the MVC/...
2
votes
2
answers
383
views
Exposing methods for polymorphic children from the aggregate root
Consider the following fictitious toy example:
There is an aggregate root DayChecklist that holds a list of Tasks planned for the day:
class DayChecklist {
String id;
DateTime today;
...
...
1
vote
2
answers
171
views
Is it allowed in DDD application to expose HTTP API endpoints for objects different than aggregate roots?
It's rather common knowledge that aggregate root provides an interface for every state change within that aggregate. For instance, aggregate root checks some business rules before some dependent ...
2
votes
2
answers
400
views
Can a query handler (not repository) access a web service?
Say I have the following class, which maps to a database table:
public class Person
{
public Guid Id {get; set; }
public string Name {get; set; }
public DateTime DateOfBirth {get; set; }
...
1
vote
0
answers
57
views
I have to have one application layer for all the projects or one application layer for each project?
I have a project with various bounded contexts. I have Purchases bounded context and product bounded context.
The two projects are developed by two diferent persons, so I am organazing the projects in ...
1
vote
1
answer
261
views
Does calling an external API a part of transactional boundary
I have the following requirements :
A player in an FPS Shooter game has health points, where he can take damage and regain health.
One of the ways to regain health is by using a Health Booster that ...
0
votes
3
answers
609
views
Is it needed a unit of work with DDD?
Reading about DDD, i have read that it is needed to have a repository per each aggregate entity.
For example, in an ordering system, I should have a repository for the order and another repository ...
0
votes
0
answers
52
views
how to design the bounded contexts in DDD?
The context, or bounded contexts, it could be defined as a logical boundary of a domain where particular terms and rules apply consistently.
There are another definitions but more or less, this could ...
0
votes
2
answers
313
views
Mediator Pattern in c# - using a mediator to trigger policies
I'm wondering how i can implement what Im calling "business policies" in my code? For discussion purposes, let's say I have two separate contexts - synchronizeUsers and Licensing.
The ...