Skip to main content

All 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 ...
Douglas Monteiro's user avatar
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 ...
lamb_bd85's user avatar
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 ...
Valerii Sloboda's user avatar
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; ...
Bojan Vukasovic's user avatar
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 ...
noctonura's user avatar
  • 281
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 ...
user avatar
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 ...
Bojan Vukasovic's user avatar
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 ...
ovnia's user avatar
  • 461
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. ...
Amit Mizrahi's user avatar
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 ...
Zymus's user avatar
  • 2,533
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 ...
uylmz's user avatar
  • 1,139
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? ...
Adem İlhan's user avatar
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){ ...
Songo's user avatar
  • 6,663
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> ...
Songo's user avatar
  • 6,663
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 ...
Songo's user avatar
  • 6,663

15 30 50 per page