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)

0
votes
1answer
38 views

Where do I create/instantiate repositories in DDD that are used my Domain Services

From what I understand a DomainService should be implemented against a RepositoryInterface, so we could change with easy the repository (which its a part of the Infrastructure layer) So, if I have: ...
2
votes
3answers
40 views

In CQRS/ES, can a command create another command?

In CQRS/ES, a command is sent from the client to the server and routed to the appropriate command handler. That command handler loads an aggregate from its repository, and calls some method on it, and ...
0
votes
0answers
32 views

In an event driven microservice environment, are domain events equal to topics?

A lot of messaging frameworks have the term "topic". In a ddd microservice architecture, do these topics always reflect the domain events?
1
vote
1answer
78 views

How to atomically create a new entity in multiple contexts without coupling?

Let's assume there are multiple contexts with the same logical entity but with different notions. Creating such an entity should have the side effect that in all other contexts the same logical entity ...
2
votes
1answer
69 views

What's the difference between an implementation detail and a technical concern

I just wanted to make sure that I understand and can properly articulate the difference between these two concepts. I've always thought of an implementation detail as being the internal workings of ...
1
vote
1answer
45 views

Where should you validate the state of “other” aggregates?

Scenario: A customer places an order, then, after receiving the product, provides feedback on the order process. Assume the following aggregate roots: Customer Order Feedback Here are the ...
4
votes
2answers
96 views

Is there an elegant way to check unique contraints on domain object attributes without moving business logic into service layer?

I have been adapting domain-driven design for about 8 years now and even after all these years, there is still one thing, that has been bugging me. That is checking for a unique record in data storage ...
5
votes
2answers
118 views

Recreating complex aggregates from a persistance source

I'm building a web application with C#, and I have an aggregate root which has several entities and value objects. Then I have a repository object which persists the aggregate to the database (I'm ...
0
votes
0answers
36 views

Is there a ddd approach for sending events about embedded aggregate views

I'm investigating how we can notify UI/async clients (websocket) about an update which happened in an embedded view. Let me elaborate... We currently have a newsfeed where NewsItem is an aggregate ...
5
votes
3answers
110 views

How do you deal with legacy data integrity issues when rewriting software?

I am working on a project which is a rewrite of an existing legacy software. The legacy software primarily consists of CRUD operations (create, read, update, delete) on an SQL database. Despite the ...
2
votes
2answers
120 views

Could REST api be considered as a presentation layer in DDD?

I read a lot of questions about this concern, and some of them are Presentation VS Application layer in DDD Application layer vs domain layer? So my question is if the top layer is REST API and ...
6
votes
2answers
214 views

Is the command design pattern a good way to reduce the number of dependencies in my class?

I recently realized that I have way too many dependencies in many of my classes. Now I am trying to solve that for the most important class. I think I have an idea how but I'm not sure if it is the ...
2
votes
1answer
83 views

Can I manage transactions in the UI

Do I need an "application/service" layer to manage transactions if the domain layer only services the UI? In other words, can't I just manage transactions in the UI when I have only one consumer of ...
0
votes
2answers
38 views

Domain object using DAO within a transaction

Is it considered good practice to start a transaction in the "service/application" layer, and then have objects in the domain model make DAO calls which participate in that transaction?
3
votes
3answers
87 views

How can you separate a monolith into domain-driven libraries without duplicating interfaces and still keep dependencies simple?

I'm working on a project with web services, and I've been structuring things where: The web service contains the business logic layer A library which handles the data access layer I've recently ...
10
votes
4answers
329 views

Is it still valid to speak about anemic model in the context of functional programming?

Most of DDD tactical design patterns belong to object-oriented paradigm, and anemic model describes the situation when all business logic is put into services rather than objects thus making them a ...
4
votes
2answers
162 views

Ubiquitous language and maturity level in REST API?

According to Richardson Maturity Model there are several levels of maturity in REST approach. http://martinfowler.com/articles/richardsonMaturityModel.html Since DDD uses ubiquitous language, I am ...
5
votes
2answers
45 views

How can I protect an EventSourced aggregate from user-generated event storm?

Let's say you're building a social web app where an aggregate root (f.e. BlogPost) could be liked and unliked. Now consider a malicious user who wrote a script to perform an endless amount of like and ...
1
vote
0answers
99 views

How to authentication user in REST API (domain driven design)

I am using REST API as a presentation layer of a DDD project. In order to secure API calls I am using token based security. ...
2
votes
3answers
85 views

What should be primary guideline when defining a bounded context?

When defining bounded contexts of a Domain, what should be a primary guideline: departments (Sales/Manufacturing/Warehousing), where each department has a common context ...
2
votes
3answers
92 views

How to clearly define boundaries of a bounded context

After a month or so of reading and researching DDD, I decided to start my own project and created DDD with these bounded contexts> Clients Products Orders Billing Each bounded context has rest API ...
1
vote
1answer
100 views

why exposing service instead of repository in onion architecture

I'm digging on how to structure projects and so I stumble into Onion Architecture. As to how I understand it, its more on a domain-centered-focus architecture instead of a database-driven type. I'm ...
5
votes
1answer
42 views

Using domain events to express some reached state

In general, domain events are used to make a notification, when something has happened to entity, but is it okay - from perspective of ddd - to use domain events to make a notification, when entity ...
1
vote
1answer
38 views

How can I cascade changes from one aggregate root to another?

I'm having trouble modelling a relationship in DDD. I have four entities: Claim - defines access to a Service. Service - a web service. A Service has many Claims and can belong to any number of ...
4
votes
4answers
296 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 ...
2
votes
3answers
126 views

In DDD, is validation application logic, or domain logic?

Suppose that we are modelling a form using DDD; the form may have certain kind of business rules associated with it - perhaps you will need to specify an income if you are not a student, and you are ...
4
votes
1answer
114 views

Using delegates as named lambdas

Suppose we have a domain in which we can generalise some operation by passing in a function, like the Select \ map functions. Now suppose that the function we pass in has some domain specific name, ...
5
votes
2answers
177 views

DDD: Creating reusable modules and service type distinctions (Domain, Infrastructure, Application)

So after reading "Implementing Domain-Driven Design by Vaughn Vernon" I've decided to refactor my code for better re usability by isolating what I believe to be core domain concepts into separate ...
3
votes
2answers
85 views

Repository pattern and Dependency Injection without an ORM

I want to implement the repository pattern in an old legacy project. I already did some research, and found that, without an ORM, it's completely acceptable to have methods like ...
4
votes
4answers
229 views

If Repository Pattern is overkill for modern ORMs (EF, nHibernate), what is a better abstraction?

I've recently read a lot of arguments against using the repository pattern with powerful ORM's like Entity Framework as it incorporates repository-like functionality, along with Unit of Work ...
0
votes
0answers
67 views

Bringing in unit test code with Mocking Frameworks in an established ASP.NET C# software application

Here is the information about my development environment: MongoDB 3.0.0 MongoDB C# Driver Version 1.7.0.4714 Microsoft Visual Studio Professional 2013 .NET Framework 4.0 We are about to do our ...
2
votes
2answers
88 views

Multiple implementation architecture inside a single bounded context?

In all DDD books I read so far, they say a bounded context can have its own implementation architecture, which suggests a single architecture per bounded context. In my journey of DDD and also CQRS, ...
2
votes
2answers
136 views

Are DDD aggregates a good boundary for unit testing?

An aggregate can represent a somewhat stable system boundary. Does it make sense to write input and output test aggregates to do most testing? In theory we could use an aggregate as a data driven way ...
1
vote
2answers
127 views

Transactional consistency with external API calls

I have an DDD application that makes use of two external APIs: Google Calendar API and Google Gmail. In one of the application services I want to create a calendar event (using the Calendar API) and ...
17
votes
3answers
420 views

Relational databases and iterative development

In many approaches to software development like agile methodologies, Domain-Driven Design and Object Oriented Analysis and Design, we are encouraged to take one iterative approach to development. So ...
2
votes
0answers
66 views

How to implement Repository that supports ORM's validation?

DDD has an abstract repository pattern to handle saving and fetching/finding entities in storage (db, external service, doesn't matter). My question is if Repository pattern has to only bring the ...
1
vote
2answers
72 views

How should an entity that abstracts an external service do its operations?

I'm creating a system using some DDD principles and I'm stuck with a problem. To give a bit more of context on what I'm trying to do, let me first describe what the system is about: The ideia is to ...
0
votes
3answers
118 views

DDD: Saving changes from UI to domain object

In many cases, there are different kind of forms in an application's user interface, and these forms are use to collect all the data - that is needed to update (or create of course) domain object ...
4
votes
4answers
157 views

Domain Driven Design and Cross Domain interaction

I am a relative DDD newbie, but I am reading anything and everything I can get my hands on to boil out and distill my knowledge. I came across this DDD question, and one of the answers has me ...
0
votes
0answers
52 views

Namespace naming and parts of speech

I keep coming up with the following Namespace names. They feel right when I just type them out in a text editor, but it's bothering me that they're not the same .. I'm going to use the word "part of ...
2
votes
1answer
97 views

DDD aggregate and component structure [closed]

What do you consider that is there relationship between DDD aggregate and architectural component? I think that it is quite reasoned that services, which are related to specific aggregate, defined a ...
1
vote
1answer
99 views

Are there more or less straightforward guidelines for adopting one or another approach to reporting in DDD? [closed]

Vernon and Millett describe several patterns of getting data for ui (reporting in general) needs. Though some pros and cons of each approach are discussed, I could not get a robust understanding of ...
1
vote
3answers
101 views

Event Sourcing and cross-context aggregate

I had this idea of different write models being used in different bounded contexts, but both being the same aggregate instance (the same events). For example consider a User aggregate that is used ...
0
votes
1answer
74 views

What is a Collection of Aggregates Referred to in Domain Driven Design?

E.g. in a domain model with two aggregate roots: book author Is there a specific term that refers to a collection of aggregates of the same root type (e.g. a collection of books)? In Confusion ...
3
votes
3answers
437 views

in DDD, should repositories expose an entity or domain objects?

As I understand it, in DDD, it is appropriate to use a repository pattern with an aggregate root. My question is, should I return the data as an entity or domain objects/DTO? Maybe some code will ...
1
vote
3answers
152 views

When a class represents a property that might be invalid, how should the validation be done?

I have a Product class which has among others an attribute Ean13 that encapsulates an EAN13 code. Here is a prototype of the Product class: @Entity @Table(name = "tb_produtos") public class Product ...
8
votes
7answers
419 views

Design pattern for “operation on object allowed, only if object is in certain state”

For example: Only job applications that are not yet in review or approved, can be updated. In other words, a person can update his job appliance form until HR starts reviewing it, or it's already ...
2
votes
2answers
128 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 ...
1
vote
3answers
185 views

How to best encapsulate features in software design?

I like domain driven design, and onion design. However I would really like my features to be encapsulated. If i check out some legacy code and I need to investigate some specific feature the best ...
2
votes
3answers
197 views

When using DDD and CRQS, should be exactly one event per command?

I am looking for a way to design a ddd application with convention over configuration. Say an aggregate "Client" has a command defined "FillProfile". It will logically raise an event "ProfileFilled". ...