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
0answers
49 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
190 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
16 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
40 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
68 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
80 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
76 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, ...
4
votes
1answer
82 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
78 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
45 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
31 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
91 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
68 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
109 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
64 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
74 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
240 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
42 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
43 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
90 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
191 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
43 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
74 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
135 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
113 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
389 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
152 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
179 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
185 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
160 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
125 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
50 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
301 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
48 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
103 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
79 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
109 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
50 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
149 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
322 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
111 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
211 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
182 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
92 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 ...
2
votes
6answers
375 views

Object Design & Cohesion - Issue & potential refactoring

Abstract I have been trying to get my head around the cohesiveness of some functionality in our code base. I’ve approached this design in different ways, and lately I’m convinced that I took the ...
1
vote
3answers
162 views

“Cross-cutting” domain in DDD

I've recently started studying Domain Driven Design and so far it looks like it will help tremendously with my team's current project. I'm running into a bit of a problem though actually determining ...
2
votes
2answers
334 views

Repository pattern implementation that knows nothing about the database table and column names

I've seen around the Internet and Github, implementations for the design pattern Repository that knows about database table and column names. I was think, if I want to work with the database as a ...
0
votes
0answers
51 views

Reporting Logic vs Domain Logic

Should the reporting logic to extract domain data in a certain format reside in domain objects or separate reporting objects? The reporting logic needs to: select entities/data which match selection ...
1
vote
1answer
209 views

What is a good practice to push notifications in a “near real-time” delay in this case?

I want to enable some real-time notifications about friend's activities (social network). Technical context is: Webapp calling backend (REST API's). Scenario is: Kevin follows Bob. When Bob ...
1
vote
1answer
81 views

DDD with entities with no relations

Disclaimer: I'm not 100% sure I understand some of the practices and concepts in DDD, so this question may actually be answered by clarification of the ideas I'm working in a legacy system (written ...