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
81 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 ...
0
votes
1answer
53 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 ...
8
votes
2answers
217 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 ...
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 ...
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
votes
1answer
60 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 ...
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 ...
4
votes
3answers
256 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
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 ...
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 ...
0
votes
1answer
100 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, ...
5
votes
1answer
118 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
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 ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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
2answers
547 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, ...
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 ...
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 ...
2
votes
1answer
270 views

Fire domain events after transaction completes

I am trying to implement a domain event system that only fires its events when the associated unit-of-work commits successfully. The main reason why I want to do this is because I have other ...
1
vote
2answers
194 views

Limitations of the Identity Map pattern

After asking about the implementation in Ruby of the Identity Map pattern because the potential memory leak in long running server apps, I am considering my initial concept of that pattern. Initially ...
0
votes
3answers
127 views

Assigning responsibility for cancelling an Order

During a conversation with our Domain Expert we can across this feature: A Customer service agent can cancel an Order by decreasing its quantity. To cancel an Order we decrease its quantity by the ...
0
votes
0answers
67 views

Security in Transversal Layer in Domain Driven Design

I'm building a solution based on Domain Driven Design, I'm trying to implement the security system (authentication, authorization, roles, system configuration, connection strings, etc..) in a ...
0
votes
3answers
321 views

How do you make a service stateless?

When doing Domain Driven Design it is advised that services should be stateless. There are several kinds of services when doing DDD: Application services. Domain services. Infrastructure services. ...
0
votes
0answers
50 views

Extending database model of ORM in subproject

I have a maven project which contains some entities which are stored in a database. The purpose of this project is to manage personal information, users, locations, etc. This project can work on its ...
1
vote
2answers
105 views

How far can I drift from my original domain model and still have the benefits of an ORM?

I have the following domain models: public class User { public int Id { get; set; } public ICollection<Product> Products { get; set; } } public class Product { public int Id { ...
1
vote
2answers
81 views

Design of active or passive class domain [closed]

Sorry if my (simplified) example is too broad. Given this model (written in C#): class Ball { } Let's assume that a ball can be launched. To implement this feature, I can define something like: ...
1
vote
1answer
112 views

Domain-specific Interfaces

Are there any real benefits of using interfaces over abstract classes in a domain model? Does anyone have any experience using interfaces in a domain model in a real project? From a technical ...
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 ...
2
votes
2answers
185 views

Should I use the repository in the Domain Object or push the Domain Object back to the Service Layer?

I have come from a transaction script world and I am just starting to take a look at DDD. I am unsure of the correct way to integrate a DDD design with database persistence. This is what I have: A ...
0
votes
1answer
367 views

Onion Architecture Structure

I am looking to understand and implement the Onion Architecture and have a vague idea on how to structure everything but need help to clear up some of my confusion. Based on different examples and ...
2
votes
1answer
114 views

If the UI layer depends on the Application layer. Who starts the application/process?

This is related to DDD for a desktop application in c#...with 4 layers ui/application/domain/infrastructure. Actually 3 desktop applications sharing part of the domain and part of the infrastructure. ...
2
votes
2answers
264 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
207 views

Sanity check for design pattern used with an intricate calculation model

I am working on a project that generates technical brochures in batch. The 3rd party API that is being used expects POCOs with property names that match field names used in each of the brochure ...
1
vote
1answer
99 views

Should a domain object wrap/contain a DTO interface?

Using .NET - I have an interface IPerson. This interface is implemented by classes in multiple, separate repositories, e.g. EF6 (EfPerson), custom SQL (SqlPerson), or even custom assembly connecting ...