2022 Developer Survey is open! Take survey.

Questions tagged [domain-model]

A domain model is composed of the objects, behavior, relationships, and attributes that make up the industry that is the focus of development.

Filter by
Sorted by
Tagged with
0 votes
0 answers
55 views

Domain-driven Design: Aggregate root property is a collection of other independent aggregate roots

In my domain model I've got two principal entities: User and Event, both which I've decided to make aggregate roots. Users and Events have a one-to-many relationship wherein Users can create several ...
user avatar
0 votes
0 answers
90 views

How to handle presentation/UI rules in DDD context?

I'm wondering how a rule tailored for a specific UI is handled in a context of DDD and hexagonal/onion architecture? For example, if you have a screen for an inventory app where you can create product ...
user avatar
31 votes
9 answers
7k views

Is extracting an interface just for testing purposes a code smell?

I will explain with an hypothetical example. Suppose that my domain is Cars. Everyone around the software, talks about cars. Car is the aggregate root of aggregate roots. For example, CAR table has ...
user avatar
  • 695
0 votes
0 answers
25 views

Modeling a predicate/criteria builder

For a project I am currently doing, I am supposed to build a way to express "rules" about a certain system in a database and then be able to check if entities fulfill this ruleset or not. ...
user avatar
1 vote
2 answers
126 views

Is it a mistake to distribute shopper data across microservices rather than have its own microservice?

I'm studying DDD and trying to plan how we'll migrate from our monolith to a microservice architecture. At the moment I'm trying to work through two possibilities The first is where the shopper is an ...
user avatar
0 votes
1 answer
92 views

DDD access to a composite Aggregate across Boundary Contexts

The behavior of my systems, is as follows user places an order for a product 1a. order management creates a placeholder record for the order 1b. forwards the order to an external vendor. external ...
user avatar
  • 11
49 votes
7 answers
9k views

Why is inheritance bad in a Person-Student model?

I've just started learning about Inheritance vs Composition and it's kind of tricky for me to get my head around it for some reason. I have these classes: Person class Person { public string Name {...
user avatar
0 votes
0 answers
54 views

Drawing a sequence diagram for a "View posts in a section" use case

As title says, I'm currently working on an alaysis model for a little website similar to Reddit for academic purposes. I have one use cases written like this (They're not in English so they may not ...
user avatar
  • 299
0 votes
2 answers
151 views

Explicit Modeling Aggregate Root to avoid State Pattern

In the book Patterns, Principles, and Practices of Domain-Driven Design, chapter 16, entities, Avoid the State Pattern; Use Explicit Modeling has brought the great idea of domain modeling to my life. ...
user avatar
0 votes
0 answers
53 views

Splitting nested entities keeping invariant within aggregates

I'm currently developing message imap-based module in crm app and i'm trying to connect dots using ddd principals. I've started with three main entities, all bound under Account Aggregate: Account - ...
user avatar
1 vote
2 answers
190 views

C# WPF - Is it acceptable to have a dependency to PresentationCore.dll in domain layer?

We are working on a .NET desktop application written in C# and WPF, that communicates with a REST API server. The software has a layered design and consists of multiple projects. One project for the ...
user avatar
1 vote
1 answer
73 views

What to improve/change and how to move forward with my Event Storming session?

I'm doing alone session with Event Storming for my application that I plan to build with DDD approach later on. Event Storming session is for learning purposes. My application domain logic is rather ...
user avatar
6 votes
1 answer
195 views

Should operations on properties of list objects be encapsulated in a domain class that wraps the list?

I have a list of product price objects, List<ProductPrice>. @Value public class ProductPrice { Long id; LocalDate startDate; LocalDate endDate; BigDecimal value; } From ...
user avatar
3 votes
4 answers
350 views

Do I have LocalDTOs? If yes, what is a good approach to keep encapsulation of the domain model?

LocalDTO term refers to Fowler's article. Say I have a domain entity Person: public class Person { private String id; private String name; private int age; } This entity has its own ...
user avatar
  • 695
0 votes
0 answers
130 views

Passing Domain models from Presentation layer to data layer to make a networking request

So, I have this repository(Interface) in my domain layer public protocol ProfileRepository { func becomeVerifiedDriver(licenseImageName: String, vehicle: Vehicle)-> Single<Void> } and ...
user avatar
  • 101
4 votes
4 answers
136 views

Approach to keep collection of parent entity sorted when child changes?

Assume a Person has a Phone and a Phone has Contacts. Assume in the real world the Contacts of a Phone are sorted by their first name. When I phone.add(Contact c), the phone sorts its contacts. Then ...
user avatar
  • 695
10 votes
5 answers
3k views

Pros and cons of representing routes as legs or stops?

What are some pros and cons of representing routes as legs or as stops? A leg is a departure and arrival location, a departure time and a duration (or an arrival time and a duration). A stop is an ...
user avatar
2 votes
3 answers
197 views

domain model logic behavior (ddd)

How domain model capture business logic / domain logic since i cannot access repository? I see many posts saying that domain model = business objects But Business objects live in application layer (...
user avatar
-1 votes
1 answer
162 views

How would you define a domain model for an offer/booking system?

I want to design a domain model for the following system: a customer asks a hotel for rooms availability and prices on a date the hotel send several offers: room type x, price Y, etc the customer ...
user avatar
  • 223
1 vote
2 answers
323 views

DDD - How to decouple two often used together aggregate roots

Context I'm currently developing a notification system with DDD which needs to be able to send the same notification to multiple users. For example, a group of party goers might all be notified about ...
user avatar
2 votes
2 answers
212 views

How should I structure my database entities with invites and recipients for e-signing web app?

I am interested in implementing the following requirements for my e-signature web application. A user can create a new signing contract. That contract can include multiple users to sign. The contract ...
user avatar
0 votes
3 answers
579 views

How can I coordinate updating multiple Aggregates as a result of one command, without introducing exploitative possibilities?

I'm trying to figure out how to integrate one command that updates multiple Aggregates in different contexts in a video game. The components/considerations for my particular design are DDD, CQRS, ...
user avatar
  • 2,321
18 votes
3 answers
2k views

How do you push Design changes in TDD in late development stage

I was recently part of a TDD development team. At certain point I realized that there is a design mistake instead of Object Oriented Design and Structural design the problems were solved via statuses. ...
user avatar
6 votes
1 answer
341 views

Too many conversion between layers

I'm developing a back-end application and I ran into the problem of too many conversions between layers. For a single type it is like this: So every time I update the model, I need to update six ...
user avatar
  • 191
0 votes
1 answer
265 views

Can we do domain modelling or create domain entities/models in NoSQL like Amazon DynamoDB? If yes then how?

Recently I was going through an article (link at the end) on AWS for DynamoDB NoSQL and got to know that they are suggesting to only have a single table with certain access patterns in your NoSQL ...
user avatar
2 votes
2 answers
1k views

Where should "query" business logic be placed in Domain-driven design?

System description This is a simple eCommerce application containing a Products inventory managed by an Admin. The Products in inventory/repository will show in the User App. Admin has the ability to ...
user avatar
  • 129
2 votes
5 answers
494 views

All the properties of a domain object should support NULL value?

Imagine you have an application with the domain object User: public class User { public int Id { get; set; } public string Name { get; set; } public string Surname { get; ...
user avatar
  • 59
1 vote
3 answers
233 views

How to model and unit test code with multiple side effects?

How to unit test code that requires multiple side effects? For example, making an invoice. Simple action requires few thing to happen simultaneously: create invoice in db send invoice to backend ...
user avatar
  • 181
4 votes
1 answer
149 views

Do Domain Objects Have To Be Persisted?

Does a domain object have to be persisted, or does this violate some convention about domain objects? For example, let's say I'm using an object called AuthenticationState to represent authentication ...
user avatar
4 votes
1 answer
161 views

How to name a domain concept when experts use different terms?

The DDD literature is quite clear that when a word/term has a different meaning for different users, a Bounded Context should be created to be able to separate the domain models. I'm facing the ...
user avatar
  • 3,458
1 vote
1 answer
71 views

Defining domain logic and finding the correct place to put it

I've been practicing DDD and refactoring an app to understand it's principles and applications better. However I can't fully grasp some of the ideas and how to implement them in my business domain. ...
user avatar
2 votes
1 answer
103 views

How to model an action that involves more than one model?

I'd like to start by saying that I'm new to DDD and I'm creating a hobby system to practice some concepts, so this question might be trivial, but not so much for me. I have the following scenario: I ...
user avatar
0 votes
2 answers
73 views

How can domain modelling coexist with certain database optimisations?

I'm currently working on a .NET project where we'd like to perform some computations directly on the database for efficiency (e.g. performing a join and count on the database to check if a user has ...
user avatar
  • 119
0 votes
1 answer
81 views

What is correct way to accept arguments in Domain Model when you want to add item?

I'm looking for ways how to accept arguments in the domain model when you want to add items in it. Let's take a look at this example: public class Order { public ICollection<OrderItem> Items ...
user avatar
  • 109
2 votes
4 answers
717 views

When are Description classes useful

A book called 'Applying uml and patterns by craig larm' emphasized the use of Description classes in software designing. For example, the book pointed out why putting attributes such as description, ...
user avatar
  • 39
1 vote
1 answer
202 views

Is there an equivalent to "aggregate" outside DDD?

Edit 2: Thinking about the problem some more I realized that "Can aggregates be used outside DDD?" was not the right question, hence I changed the title. For the reasons described on the ...
user avatar
0 votes
1 answer
90 views

Using a domain model to persist metrics

I am currently developing a spring boot web application in which no entity is persistent, and hence will not be saved on a database. Although, I need to be able to query some business metrics from it. ...
user avatar
1 vote
1 answer
351 views

Clean Architecture: Can Use Cases Imply UI?

In the chapter "Business Rules" of his book "Clean Architecture", Robert C. Martin comments on the relationship between use cases and the UI: [...] the use case does not describe ...
user avatar
2 votes
0 answers
458 views

How to achieve both: clean (hexagonal) architecture with JPA goodies?

How do I achieve two things at the same time writing Java Spring Application: Clean Architecture JPA goodies (@Transactional, Optimistic Locking, dirty checking, etc.) I like the idea of database/...
user avatar
1 vote
1 answer
2k views

Is it necessary to have DTO to domain entity mapping always?

I am working on a WebAPI application which follows the layered approach like Controller > Service Layer > Repository Layer > Entity Framework Core (SQL / Cosmos) The view is in Angular. In many of ...
user avatar
-2 votes
1 answer
59 views

How many states to be associated with an Order entity?

I am currently adding functionalities to Order Entity and have a column storing the state of the current order in Status. Order goes through the following workflow with minor deviations I have not ...
user avatar
1 vote
0 answers
143 views

Separating generated flatbuffer/protobuf files from domain model - best practices

I'm using flatbuffers for the first time. I've generated my java classes and have tested out serializing / deserializaing a message. Now I'm thinking about how to integrate these in to my JavaFx and ...
user avatar
3 votes
2 answers
297 views

DDD, Aggregate Root and entities in library application scenario

I'm building a library application. Let's assume that we have a requirement to let registered people in the library to borrow a book for some default period of time (4 weeks). I started to model my ...
user avatar
4 votes
2 answers
3k views

Domain Driven Design - Updating and persisting aggregates

I'm trying to wrap my head around the best possible solution in the following situation: When updating part of an aggregate, could be any part of the aggregate so either the root or any other entity, ...
user avatar
1 vote
2 answers
87 views

What's the best convention to store "other" option?

Say I have a Person object. I need to ask the user to choose from a list, which laptop they have. They can also choose the option "My product isn't listed here". Now the Person object will look ...
user avatar
  • 111
8 votes
4 answers
1k views

What kind of logic can Domain Objects realistically contain?

I have been struggling with this concept in the context of web applications ever since I first read about it. The theory states that the domain objects should encapsulate their behaviour and business ...
user avatar
3 votes
1 answer
91 views

Persistent data structure changes for changing domain model

I've learned many ways to keep a domain model flexible over the years, but there is a remaining case where the setup resists change. Suppose that we have kept our domain model properly isolated: we ...
user avatar
  • 372
1 vote
2 answers
939 views

How to deal with bad third party APIs in a microservices architecture?

I'm currently in the process of transforming a monolithic application to a microservices based architecture. The monolith is dependent on third party services (as in other departments) for its data. ...
user avatar
3 votes
1 answer
1k views

How can I provide a class diagram for a system that contains creation of an object that contains a combination of property?

I am designing a system that contains organizational hierarchy management. There are four roles in the system which are the user, admin, manager and head of procurement: I am trying to let the ...
user avatar
7 votes
3 answers
6k views

Domain vs Entities model? Domain-Driven-Design (DDD)?

In this github, https://github.com/johnph/simple-transaction, under the Transaction.Framework project, there are entities (located at Data/Entities) AccountSummaryEntity.cs AccountTransactionEntity ...
user avatar
  • 299

1
2 3 4 5
7