Domain-driven design (DDD) is an approach to develop software for complex needs by connecting the implementation to an evolving model.

learn more… | top users | synonyms (1)

1
vote
1answer
80 views

How do I Create Automated UI test code for application developed using Domain-Driven-Design with very little concrete UI requirements?

We are developing an application using Domain-Driven-Design(DDD). We have to come up with Automated UI Test code. The customer has used 3rd-party GUI Administration template ...
1
vote
1answer
47 views

Domain Driven Design and Data Conflicts

I realise it is probably overkill for what is a occasionally connected client app, but the construction of aggregates roots is bugging when thinking about it from a client perspective. For the ...
8
votes
2answers
212 views

Best practices for serialization of DDD aggregates

According to DDD domain logic should not be polluted with technical concerns like serialization, object-relational mapping, etc. So how do you serialize or map the aggregates' state without publicly ...
0
votes
1answer
52 views

Non-anemic model and SRP

I'm implementing a feature in legacy system right now. Instead of putting all my logic in some dummy application services and having anemic models, I thought I will try to do some OOP this time. I'm ...
1
vote
1answer
24 views

Models, types, different views and meta data

We have a software which purpose is to be used to help users build their own applications. It has to be very loose coupled with the infrastructure: for example, I can imagine users running it on MySQL ...
1
vote
1answer
159 views

PHP - Repository matrix pattern?

I'm trying really hard to refactor some of my legacy code in the project using best practices and design patterns + DDD so I'd love some feedback on an issue I'm currently having. Let's assume that I ...
3
votes
0answers
41 views

How to model Aggregate Roots for this music event system?

Let's say I am modeling a music event system. I have: music events listing events (the items in a lineup) - a listing event has acts (the artists playing in an item in the lineup - these can be ...
1
vote
4answers
208 views

Is DDD not appropriate for my website or should I introduce a Query Layer?

I have inherited an ASP.NET website application and the previous developer has used what I believe are some DDD concepts. I am new to DDD and I have to admit I am struggling with the practical side of ...
5
votes
1answer
117 views

“Implementing DDD” by Vernon: value object or not?

On page 382 of this book there is a passage talking about using value objects in aggregates, under the (entity) root. There is an example of Product that, besides other values, contains a ...
2
votes
3answers
3k views

Identifying Domain Services & Application Services when doing DDD

-I'm trying to figure out how to identify Application Services in my application. I think I can identify a Domain service by 2 things: It acts as a facade to the repository. It holds business logic ...
-1
votes
1answer
59 views

New DDD, context-oriented, functional… approach in building business layer [closed]

We are building some business modules that must be intuitive for developers to use, so the code itself explains and forces developers to use it in certain way. This applies both for enhancing the ...
0
votes
1answer
62 views

What are the boundaries of Domain Events?

As I get it, domain events imply loose coupling and separation of responsibilities. That's fine. But if domain events are allowed to cross aggregate's boundaries then it is a question how to guarantee ...
13
votes
2answers
2k views

Domain-Driven-Design - external dependencies in the Entity problem

I'd like to start Domain-Driven-Design, but there are several problems I'd like to solve before starting :) Let's imagine I have a Groups and Users and when user wants to join a group, I'm calling ...
1
vote
1answer
221 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){ ...
4
votes
3answers
252 views

DDD, modularizing the application and domain layers without breaking the DIP

Quoting DDD theory: The application layer is thin in terms of domain logic - it merely coordinates the domain layer objects to perform the actual work. When it comes to modularization, and ...
1
vote
0answers
58 views

What and how much domain code should be put in an F# module

According to recommendations given here, F# modules should correspond to DDD bounded contexts, i.e. subdivisions of a business domain. The bounded context I'm working on right now has 2 aggregates ...
3
votes
1answer
49 views

DDD models and localization?

Let's say I have a Book that has it's title and description localized in any number of languages. Localization only matters for e.g. administrators, because users chooses their localization and they ...
2
votes
1answer
72 views

DDD and edit of Aggregate's descendants

In a DDD approach, suppose I have an Order (this is my aggregate root) and a Line (a descendant of an Order). In both objects I have private setter for properties and a builder that handle creations ...
1
vote
1answer
250 views

How does a search functionality fit in DDD with CQRS?

In Vaughn Vernon's book Implementing domain driven design and the accompanying sample application I found that he implemented a CQRS approach to the iddd_collaboration bounded context. He presents ...
0
votes
1answer
99 views

Event sourcing - performance penalty? [closed]

I am trying to convince people in my company that we should switch to event sourcing. Our software is a product that consist of many modules - like a module for wiki, blogs, documents, etc. I would ...
3
votes
2answers
86 views

Reverse relationships for smaller/better Aggregates?

Let's take an example: we have two related entities, like Question and Choice. This is a poll: it contains of single question that may have 2 or more choices. Each choice can be voted for by users, ...
1
vote
1answer
47 views

DDD: storing additional data with the model

Our domain is operated within certain context. This context is described by some additional values, like a fooId - id that does not have a meaning in domain business, but it's more a flavor for the ...
2
votes
1answer
92 views

DDD: Global unique identities vs surrogate

Let's start with an example: we have an entity: Book. It has unique identity: Isbn - a value object that wraps a String. This is an UUID. The Book entity also needs a surrogate id from the repo (sql ...
2
votes
1answer
96 views

DDD: placement of method whose behavior may be implemented with single database query

Let's say we have Book entity in our library. A requirement says: Librarian may disable 'available' flag to books published before some year. For example, librarian may 'hide' some old books from ...
16
votes
5answers
5k views

Are DDD Aggregates really a good idea in a Web Application?

I'm diving in to Domain Driven Design and some of the concepts i'm coming across make a lot of sense on the surface, but when I think about them more I have to wonder if that's really a good idea. ...
1
vote
1answer
46 views

Inter-aggregate commands/transactions in an eventual consistency manner

I am trying to model a business transaction that operates on two aggregates. Let's say we have a Bag aggregate type that contains Items (entities). I would like to have a command ...
0
votes
2answers
73 views

DDD: service/repo operations on IDs or instances?

This might be silly, but: let's say I want to delete a Book from the repo. Should I: deleteBook(bookId) - send the ID since in the most of the time, the ID is passed from the UI or ...
0
votes
2answers
128 views

DDD: How to refer/select a value object inside aggregate?

We have an aggregate of: entity: Poll (representing a question) two or more value objects Choice Adding choices is done through Poll, repository stores only the aggregate, i.e. everything is done ...
0
votes
1answer
48 views

Is it ok to have special domain factory - or something similar - directly in DAL?

In DDD application, I know that Domain Factory should be the single point of Domain object creation (input from the UI, the results of queries from persistence) - but I'm facing a problem that for ...
6
votes
3answers
213 views

In domain driven design, how do I convert a database table with a primary key into a Value Object?

Lets suppose there's a database schema defined like this: Person.mail_address_key ----- Address.address_key Person.billing_address_key ----- Address.address_key A Person has a mailing address and a ...
0
votes
1answer
70 views

DDD: Alternative view of the Model?

I have a model class, let's say it's a Book. I need it to be displayed on the screen. I want to have an escaped version of it, so I do not need to escape fields manually. What should I do? I can ...
1
vote
2answers
94 views

DDD and collections and paging of related models?

I have a rich model, where e.g. one model A depends on many related entities/value objects. Therefore we have methods in A for retrieving collections of related objects: getFoos(), getBars() and so ...
5
votes
3answers
243 views

Model relationships with DDD (or with sense)?

Here is a simplified requirement: User creates a Question with multiple Answers. Question must have at least one Answer. Clarification: think Question and Answer as in a test: there is one ...
1
vote
4answers
95 views

Domain Model, validation, and pushing errors to the model

Looking into DDD and something I noticed is that business logic should be in the model, otherwise you just have property bags. That said how do you handle pieces of validation that require a trip to ...
2
votes
3answers
116 views

Is there any reason to override Equals for an Entity?

An entity has identity, which implies there should only be one object (e.g. a particular customer) in memory. As such, reference equality (which is what the base version of object.equals checks for) ...
1
vote
1answer
51 views

What should the payload of a “domain event” generated through “change data capture” include?

Using domain driven design and event sourcing ... Given I have a table of 3 columns: (A, B, C) with an existing row of data: (1, 2, 3), when I update the row to contain values (1000, 2, 3) and I run ...
0
votes
2answers
78 views

DDD - If an object is saved as a whole to the database, is it per definition an entity, or is it still possible that it is a value object?

I'm learning about Domain Driven Design and struggling with the question if a particular object should be handled as entity or value object. All possible surname prefixes are kept in a database ...
0
votes
0answers
44 views

Is there a pattern for deserialization involving repository access? Or what is wrong with my design?

Let us have case class Money(amount: BigDecimal, currency: Currency) case class Currency(code: String, alpha3: String) Money is a value object and Currency is an entity. When transforming Money to ...
6
votes
3answers
449 views

Resources for popular domain models [closed]

I have come across many situations where I had to build a system for a library or a clinic or other popular domains. The thing is a domain model for a library was probably done 1000 times already with ...
2
votes
2answers
193 views

In DDD are Value Object always at the leaves of a relationship tree?

If I have a photo album where each Photo can be commented on, Should the Comments be Entities or Value Object in these cases: Comments can be added only anonymously (i.e. Comments have no relation ...
0
votes
0answers
73 views

What should a domain object's validation cover?

I'm trying to figure out how to do validation of domain objects that need external resources, such as data mappers/dao Firstly here's my code class User { const INVALID_ID = 1; const ...
7
votes
3answers
340 views

Computed Values and Simple Reads - A nagging pain for my Domain Driven Designs!

The problem I continually face is how to deal with computed values driven by domain logic while still working efficiently against the data store. Example: I'm returning a list of Products from my ...
3
votes
2answers
349 views

Developing the Domain Model alone

In DDD examples it seems the common method for developing the domain model is to sit with domain experts and iterate over versions of the model, say on a whiteboard, continually modifying it and ...
3
votes
3answers
1k views

Presentation VS Application layer in DDD

I have trouble drawing a clear line between Presentation and Application layer in Domain Driven Design. Where should Controllers, Views, Layouts, Javascript and CSS files go? Is it in the ...
6
votes
2answers
2k views

DDD Bounded Contexts & Domains?

I've been working in a relatively complex application with 10's of database tables (Aggregates, Entities/Value Objects) and applying DDD. At this point it appears to be basically DDD-Lite meaning that ...
6
votes
6answers
8k views

Application layer vs domain layer?

I am reading Domain-Driven Design by Evans and I am at the part discussing the layered architecture. I just realized that application and domain layers are different and should be separate. In the ...
1
vote
0answers
172 views

Separation of concerns between repository and service in DDD with complex entities

This probably seems as an example of opinion-based question, but I'm actually looking for rationale on how to decide correctly, I believe there is a correct solution that can be backed by solid ...
1
vote
4answers
154 views

Domain model associations that do not required the behaviour of the associated object. How to model?

I've been struggling with this question for a while. I'm specifically thinking within the object orientated domain model. Let's say I have two entities. A supplier and a customer. There is a ...
2
votes
2answers
260 views

How to work with large aggregate roots?

I'm learning DDD and yet I have more questions than answers. Let's consider a model of a directory containing enormous number of files. Here is how I see it: Directory is an Aggregate root. This ...
1
vote
2answers
543 views

Is this a good Visual Studio solution structure for a domain driven design RESTful web service?

I am building a .NET 4.5 C# Web API RESTful solution and I would like someone to tell me if my project solution is correct and/or wise(-enough?) for a solution designed using Domain Driven Design, ...