All Questions
16 questions
0
votes
2
answers
417
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 ...
0
votes
3
answers
3k
views
DDD - storing and retrieving entities of an aggregate from the outside
In my doctor's appointment booking system, I identified the following entities:
Doctor
Patient
Appointment
I also identified an aggregate, which is Doctor (aggregate root) and Appointment. It's an ...
3
votes
4
answers
1k
views
Role of DTOs in Rich Domain Model
I work with Spring applications. Recently I have found this article about the Anemic Domain Model.
They recommend putting logic in Entity classes. It solves a problem that Martin Fowler described in ...
1
vote
1
answer
2k
views
Composite DTO or flattened DTO?
I'm having problem deciding which of these 2 structures to use from my DTOs:
Option 1 is:
@Data
class Lines{
private final Line[] lines;
}
@Data
class Line{
private final String[] specifiers;
...
16
votes
7
answers
3k
views
Primitive vs Class to represent simple domain object?
What are general guidelines or rules of thumb for when to use a domain-speciifc object vs a plain String or number?
Examples:
Age class vs Integer?
FirstName class vs String?
UniqueID vs String
...
6
votes
3
answers
1k
views
Persistent Model to Domain Model mapping without exposing domain object's attributes
I know this is a common question, but I haven't found another that solves my doubts.
Usually, if the project is small, I've persistence annotations in the same object that represents the domain ...
4
votes
4
answers
187
views
Class design problem - splitting differences or making workarounds?
I have this problem: Class1 and Class2 are of same Base type. They are representing the same concept but with slightly different implementation. If I model them "the right way" in Java, I would have ...
3
votes
2
answers
1k
views
Value object that depends on multiple aggregates' lifecycle in DDD
During prototyping a simple ddd application from public transit domain I've faced a problem with one value object - Transit Pass:
Each Customer can buy a transit Pass thatallows a passenger of the ...
1
vote
1
answer
307
views
Modeling complex tree structure
After asking it in stackoverflow : polymorphism-and-tree-structre
I came to a conclusion that I am not being specific and my question is not about any specific technology so I will try to rewrite it.
...
6
votes
4
answers
739
views
Should an object be able to represent itself across components?
I'm working on a networked game. I have tried to design the various components (client, server, engine) to only about things within their domain. For example, the server should only be concerned with ...
3
votes
2
answers
225
views
Domain driven design - Entity is updateable in certain circumstances
Here is my business rule:
Anyone (anonymous users) can make an Application (as in to apply for something). Applications can be updated until they are reviewed and approved by an officer. Approved ...
2
votes
2
answers
1k
views
DDD Request Validation Handling
I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
2
votes
2
answers
2k
views
From a DDD perspective is a report generating service a domain service or an infrastructure service?
Let assume we have the following service whose responsibility is to generate Excel reports:
class ExcelReportService{
public String generateReport(String fileFormatFilePath, ResultSet data){
...
7
votes
5
answers
5k
views
How to model an address type in DDD?
I have an User entity that has a Set of Address where Address is a value object:
class User{
...
private Set<Address> addresses;
...
public setAddresses(Set<Address> ...
1
vote
2
answers
494
views
Determining the aggregates in this domain
I'm working on an ordering system where we receive tab delimited files that look like this (I removed most of the columns for clarity):
OrderId OrderLineId BuyerName BuyerAdress ...