Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [domain-driven-design]

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

3
votes
1answer
52 views

How do I migrate part of a business process to DDD?

I am quite new to DDD, but I am currently working on a system which has a payroll element to it. I have a requirement to send payslips to an external system when they are created. Currently the ...
3
votes
1answer
362 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 ...
3
votes
1answer
529 views

Design for syncing data from remote API

I am trying to find a robust and correct solution for syncing data from different sources to my local relational database. I have different sources of data for eg: CSV, REST API and probably network ...
3
votes
1answer
211 views

Domain Events Groupping/Buffering

Suppose I have 3 domain events, Event1 Event2 and Event3. When command arrives at my Service Layer, I can rise 2 commands at the same time - e.g. Event1 and Event2. One Class has event listener for ...
6
votes
0answers
550 views

Entities (DDD) when using CQRS on Akka

When using Akka, CQRS style, is still there a place for Entities? Or does everything now go to Aggregates, implemented as Actors + Value Objects. I notice that most entities are written as mutable ...
2
votes
0answers
61 views

UI syncing in case of bulk operation api

In a CQRS system, the convention that we follow is we render the detail view of an aggregate(i.e getById) using the write model and views containing multiple aggregates(like a dashboard) using read ...
2
votes
0answers
49 views

How to design a sync api exposed to third party which involves a business transaction across aggregates?

Business Domain In the Sales domain, I have 3 entities - Lead, Contact and Opportunity. A lead is injected into the system from many sources and nurtured. If it is a prospect then it is converted ...
2
votes
0answers
233 views

Balance between aggregate boundaries and domain consistency in DDD

Designing an Aggregate and choosing an Aggregate Root getting tricky for me all the time especially when it comes to ensuring right transactional contexts and consistency constraints so I'm wondering ...
2
votes
0answers
447 views

DDD problem with aggregate design (users, authentication)

We're having a bounded context dealing with payments. I'm trying to model case, where Merchant can create another merchant and inherit some of its properties in this case: users that are needed for ...
2
votes
0answers
307 views

Examples for “serverless” Java service for AWS Lambda

Doesn anybody have practical experience with implementing a (micro)service based on AWS Lambda? My team is currently working on an MVP. We started with a monolith and that has worked very well. It's ...
2
votes
0answers
2k views

DDD directory structure for MVC app

As a means of learning and gaining some experience with domain-driven design, I'm restructuring/refactoring an old application written in PHP which utilizes the Laravel 5.1 framework. Below is a mock-...
2
votes
0answers
287 views

Understand the service term in DDD and matching class diagram

I m trying to learn how to make my code better. This way, I try to learn some books and understand them. I m having some troubles dealing with Domain Objects. From the first year of my IT school, I'...
2
votes
0answers
171 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 ...
2
votes
0answers
195 views

CQRS “private” command

In CQRS, if a saga (or more precisely a process manager according to the CQRS Journey book) sends out a new command to change aggregates how can I ensure that this command is not possible to send from ...
2
votes
0answers
633 views

How to implement DDD in a distributed application with NHibernate?

I have an ASP.NET MVC web site working in this way: (In the controller) var user = _applicationService.GetUserById(1); user.ChangeEmail("mynemail@somewhere.com"); user.ChangeAddress("my new street", ...
1
vote
0answers
59 views

Domain Service vs Domain Events

What is the difference between using domain services and domain events? The thing I can see is that domain events allow you to further decouple your domain model and get away from using domain ...
1
vote
0answers
61 views

Splitting a Bounded Context - administration and execution

TLDR: not quite sure whether I got my Bounded Context right. Situation I have a domain model in one Bounded Context: Entire model is in the same bounded context. Bounded context has two ...
1
vote
0answers
53 views

DDD: How to resolve aggregate members needing dependecies?

I have the following aggregate: Checkout (root) Requirement: CouponRequirement, AnotherRequirement, YetAnotherRequirement Coupon A Checkout has many requirements that need to be fulfilled in order ...
1
vote
0answers
120 views

DDD: Application Services Code Reuse

I'm struggling in how to represent and reuse some "operations" that are commonly done by the Applications Services but aren't part of the Domain. A bit of context: I implement CQRS for the ...
1
vote
0answers
80 views

Modeling on Domain Driven Design and C4Model

I am wondering how DDD and C4Model can play together. Level 1 of Simon Brown's c4 Model is System Context diagram. So I think after you find and define your Bounded Contexts, you may start creating ...
1
vote
0answers
246 views

Putting UnitofWork handler in the Request Model for DDD with Clean architecture?

I'm rearchitecting a system in Python, using SQLAlchemy for the data mapping layer, and the Zope Component Architecture for dependency injection and interface declaration. I am in the process of ...
1
vote
0answers
319 views

Moving Role CRUD operations from the Controller to the Application Service

I am creating an administration facility for an asp.net MVC application. I am currently trying to create a form that will allow admin users to create roles. I see plenty of code, which looks like ...
1
vote
0answers
175 views

inject repository into unit of work

Please see the code below: public IUnitOfWork<PersonEntities> Create(IRepository<PersonDTO> repository) { var context = new PersonEntities(); var ...
1
vote
0answers
154 views

How to decompose workflow's node classes DDD-way?

System model has Workflow container class, instances of which may contain subclasses of the Node class, specialized for different behaviors (eg, Initial, Intermediate1, Intermediate2, Final). There ...
1
vote
0answers
213 views

Migrating from monolith to microservices reusing data layer

We are basically in process of moving from monolith system to microservices and we avoided migrating monolith system all at once, or as they call it a "big bang" https://www.nginx.com/blog/...
1
vote
0answers
143 views

Communication direction between microservices

Let's say I have 2 micro-services. One is identity and another is support. I understand when user is created inside identity ms, event will be published and support micro-service will subscribe to ...
1
vote
0answers
85 views

Most suitable solution for logging traffic to external services - ASP.NET

My application relies on several external services - labelled Service A, Service B and Service C in the diagram. I am looking at ways of logging the number of requests made to these services, and the ...
1
vote
0answers
84 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
0answers
74 views

Domain security involving domain logic

Together with my application's domain logic I am trying to outline the security model. I am stuck with a requirement that prevents me from considering security just a cross-cutting concern over my ...
0
votes
0answers
91 views

EF Core Many to Many Relationship

I am thinking about using Entity Framework Core in a new project. The project has a many to many relationship. Entity framework Core does not allow shadow state entities as described here: https://...
0
votes
0answers
42 views

Aggregate root circular dependency when data needed for calculation

My original design has a domain service that did a lot of work which resulted in an Anemic Domain Model (concepts like BalanceCalculators, AccountServices, etc.). I refactored my design which resulted ...
0
votes
0answers
11 views

Is there any value in passivation (setReceiveTimeout) for persistent actors without read store?

I am not experienced in Akka, so my assumptions may be completely wrong. As far as I understand, Aggregate Root may manage its entities either just keeping their state internally and restoring it at ...
0
votes
0answers
186 views

Can we use DAO(Data Access Object) instead repository in onion Architecture?

we are design a project in Onion Architecture. I read in various articles about the differences between dao(Data Access O and repository. In fact, we saw the structure of my project required to use ...
0
votes
0answers
132 views

Clarification on the Onion architecture's Domain Service and Application Service

I am studying Onion Architeture but i got some doubts: All the samples (github) I found over internet are too simple, or are implemented under DDD (which I have not studied at the moment) so I can ...
0
votes
0answers
45 views

Check if exists user_id when create user

I have User class class User{ public User(string id){ this.User_Id = id; } public string User_Id{get;private set;} } When I create User in Application Layer.I am checking if exists any user ...
0
votes
0answers
57 views

How to implement M-N relationship to reflect the domain correctly

If I have three entities like this: WorkingGroup WorkingTime Shift The WorkingGroup has one or more workingTime public class WorkingGroup { public WorkingGroup() { ...
0
votes
0answers
474 views

DDD - Does Many to many relationships mean two different aggregate roots?

I'm facing the following issue: I have a very simple aggregate root Product, and a product contains Image entities. Right now in code this relationship is expressed as a Many to One relationship like ...
0
votes
0answers
46 views

Different kind of settings and Settings manager persistence

I am hesitating what implementation way to choose in the following case. I have a SettingsManager public interface SettingsManagerContract { public void setStringValue(String key, String value); ...
0
votes
0answers
92 views

Strategy for fetching data from an API

I am working on a permission based system where a user can request any resource which is permitted based on his role, the resource can be one of the following types: VM DB etc. The request should ...
0
votes
0answers
228 views

DDD, REST Client and Core Domain, Bounded Context and Ubiquitous Language

I am starting to learn about Domain Driven Design by reading "Implementing Domain Driven Design" by Vaughn Vernon (tried Evans but it proved to be too hard for a complete noob, so I decided to ...
0
votes
0answers
282 views

What DDD Application Service return values do I return?

I'm trying to design an application service that will call on my entities/repos, but I'm struggling with what to return to the presenter. Right now I'm using a presenter that will call the service, ...
0
votes
0answers
6k views

Combination of the repository pattern, unit of work, and entity framework

I'm wondering how to properly combine EF, Repository Pattern and Unit Of Work. Does the solution that I have is quite correct? Example below is about Todo app ProjectController public class ...
0
votes
0answers
398 views

DDD domain code first vs db first

I am using DDD approach with c# and for data storage I am using SQL server. Also I am using code first approach with fluent api in order to build database objects from domain. Since I am using domain ...
0
votes
0answers
60 views

Visual design of Command - Event model

TL;DR I am looking for some advices in visual modeling commands and events of business process. For several weeks I, my team and some business-responsible members try to figure out how our domain ...
0
votes
0answers
321 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 ...
0
votes
0answers
458 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 ...
0
votes
0answers
58 views

How to model relationships in scenario where every product can (don't have to) be associated to only one category

This one still occupies my mind. How do you model 1:N relationships. Consider having a category and product (typical e-commerce scenario). Every product can (don't have to) be associated to only one ...
0
votes
0answers
65 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
0answers
659 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
0answers
301 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 ...