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
-1 votes
1 answer
64 views

Model Driven Engineering vs. User Centered Design

I try to understand the difference between software development approaches like MDE, and design processes like UCD: UCD is a framework of iterative processes. The end-user is the center of the ...
  • 23
0 votes
0 answers
38 views

Separating Typeorm Entities from Domain Entities [duplicate]

Is it a bad approach to add domain logic inside typeorm entities if following the domain model pattern to organize business logic. import { Entity, PrimaryGeneratedColumn, Column } from "typeorm&...
  • 57
-1 votes
2 answers
88 views

More efficient FIFO inventory calculation?

I am implementing a basic ledger system for which I want to calculate costs based on the FIFO system. Is there a more clever method than an O(n) search? Example Suppose I have two lists of ...
0 votes
0 answers
135 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 ...
0 votes
0 answers
133 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 ...
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 ...
  • 705
0 votes
0 answers
28 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. ...
1 vote
2 answers
135 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 ...
0 votes
1 answer
172 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 ...
  • 11
49 votes
7 answers
10k 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 {...
0 votes
0 answers
83 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 ...
  • 309
0 votes
2 answers
194 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. ...
0 votes
0 answers
81 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 - ...
1 vote
2 answers
251 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 ...
1 vote
1 answer
91 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 ...
6 votes
1 answer
227 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 ...
3 votes
4 answers
411 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 ...
  • 705
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 ...
  • 705
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 ...
2 votes
3 answers
259 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 (...
-1 votes
1 answer
192 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 ...
  • 223
1 vote
2 answers
468 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 ...
2 votes
2 answers
327 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 ...
0 votes
3 answers
837 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, ...
  • 2,361
19 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. ...
6 votes
1 answer
347 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 ...
  • 191
0 votes
1 answer
319 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 ...
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 ...
  • 129
2 votes
5 answers
606 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; ...
  • 59
1 vote
3 answers
286 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 ...
  • 181
4 votes
1 answer
182 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 ...
4 votes
1 answer
247 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 ...
  • 3,478
1 vote
1 answer
80 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. ...
2 votes
1 answer
104 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 ...
0 votes
2 answers
74 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 ...
  • 119
0 votes
1 answer
160 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 ...
  • 109
3 votes
4 answers
875 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, ...
  • 57
1 vote
1 answer
252 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 ...
0 votes
1 answer
94 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. ...
1 vote
1 answer
399 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 ...
2 votes
0 answers
500 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/...
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 ...
-2 votes
1 answer
61 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 ...
1 vote
0 answers
167 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 ...
3 votes
2 answers
329 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 ...
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, ...
1 vote
2 answers
88 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 ...
  • 111
9 votes
4 answers
2k 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 ...
3 votes
1 answer
105 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 ...
  • 372
1 vote
2 answers
1k 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. ...

1
2 3 4 5
7