Stack Exchange Network

Stack Exchange network consists of 175 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-model]

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

1
vote
1answer
64 views

Would I have one domain model (.NET Project) for all consumers or one domain model (.NET Project) per consumer?

Say I have a bounded context called: 'Loans' and the following APIs: HSBC NatWest TSB The three banks above are consumers and have an API. I am using the scatter gather pattern (https://www....
2
votes
2answers
99 views

Domain models vs entity models vs Hibernate lazy loading

In a new Java project I plan to use an extra layer above Hibernate entities. So there would be a CustomerEntity and CustomerDomain. The reason for that is that the CustomerDomain can contain extra ...
0
votes
3answers
109 views

REST model sharing between client and server

Consider two facts of a typical organization: Some entities are very common (e.g. Order in a POS system) Some entities might have complex relations (e.g. Order might have a list of Items, a ...
0
votes
3answers
130 views

Can an entity include “technical” (not business related) information?

I want to to follow a clean architecture rules (with domain and architecture layers). I have a problem with properties that an entity should or should not have. Let's say that I have a User domain. ...
2
votes
4answers
123 views

Migration from Anemic Models to Rich Models

I am looking into improving my overall application architecture and (I think) I understand the issues my Anemic Models are causing. Here is my current architecture: Controller with injected Service ...
3
votes
1answer
82 views

DDD - Aggregate that changes “owner” mid-process

We're evaluating CQRS/ES for a high-volume subsystem in our app in order to take advantage of distributed systems and ensure uptime. This is my team's first time implementing this architecture, and I'...
0
votes
5answers
213 views

Design Pattern for object that asks questions of another object

I'm looking for a design pattern that might work for this class I am working with. This main class is an entity using Domain Driven Design. public class TimeCard() : ITimeCardHeader { ...
0
votes
2answers
134 views

Domain Driven Design Modelling Organization -> User

Relatively new to Domain Driven Design i decided to try it out in an saas app currently under development/refactoring. I've refactored the identity part out to it's own context (class library in .net) ...
0
votes
1answer
54 views

Should I have two identical classes in two different aggregate roots?

I have an application that is modifying some XML files. Two of the files have a similar structure, with similar business logic needed to be implemented on them. I've realized that there are some ...
0
votes
1answer
57 views

Modeling entities for company invoice management software

I am making a software to store all my company invoices (and then infer some statistics about it). The idea is: My company issues invoices to it's clients. My company receive invoices from it's ...
27
votes
4answers
5k views

Is there an industry standard for gender model other than male and female?

I am modeling a database that should be used as generic non-functional requisite for all services of the startup company, like persons, users, services and commercial data like coupons, signature ...
1
vote
3answers
184 views

Modelling recurring events

I am in the process of writing a web app to track expenses and which will be multiuser. Everything is fine with a single expense, but I am struggling to find the best way to represent recurring ...
2
votes
2answers
88 views

What exactly is the term “model” defined as in the context of Domain-Driven Development?

I am reading "Patterns, Principles, and Practices of Domain-Driven Design" by Scott Millett and Nick Tune and so far it has been a great read (first 2 chapters read) but one term they seem to use a ...
9
votes
2answers
519 views

Is domain/persistence model isolation usually this awkward?

I'm diving into the concepts to Domain-Driven Design (DDD) and found some principles strange, especially regarding the isolation of domain and persistence model. Here is my basic understanding: A ...
0
votes
1answer
113 views

How to model either relationship?

I am working on a project where a user can send email to either a contact from his directory (Internal) or type an email address explicitly (External Contact) or a mix of both. We also show the read ...
1
vote
0answers
24 views

Manage web service with different version

My vendor can log in to a master management system (System A) which manage multiple subscriptions of a SaaS (System B). Each System B is hosted separately on an isolated server. System A and system B ...
2
votes
1answer
433 views

Modeling request/response in domain driven design

Say I have a class of User and that user has an Id & Name, in request response modeling, I would make a request with Name on it and a response with Id and Name, thereby my domain model would be ...
0
votes
1answer
978 views

DTO vs. read model

If I understand the concept of read models correctly, then it's just a simple query to return a use case specific data set. But a DTO seems to have the same purpose, but in a more complex way (...
-1
votes
1answer
427 views

What is an example giving the difference between Domain Model and Data Model?

I've seen many articles describing differences between Domain Model and Data Model. However none of the articles have picture representations showing difference. https://stackoverflow.com/questions/...
2
votes
4answers
185 views

Dilemma during designing a domain model

I have a class Document and document has a status: public enum DocumentStatus : byte { Incompleted, Completed, Cancelled } Now I have a dilemma I can't solve alone. Should Document have ...
1
vote
2answers
124 views

Practices for encapsulating collections in aggregate roots

How exactly should AddSomething methods in aggregate roots look like? Should I construct the objects in a call to the method, or should they be constructed inside the method?: For example: public ...
0
votes
2answers
117 views

Base class with common properties

I have multiple classes that have the same properties to be exposed. Is it normal to create a base class, which will expose those properties, to be used with descendent classes? By properties I ...
1
vote
2answers
320 views

Can command handlers be separated from aggregate roots in CQRS

On one hand, the invariants should be protected (To make invalid states impossible early and preferably at compile time rather than run time), and on the other hand, passing domain knowledge out of ...
1
vote
2answers
137 views

DDD domain identifier implementation should be ValueObject?

In DDD we defined domain's identifier as ValueObject. Regard here How ever in last project I implement those ID like so public struct UserID { public readonly string GUID; } public struct ...
1
vote
0answers
198 views

Putting the rowmapper inside the domain class

Normally in java the RowMapper is placed in its own class. Instead, what about this design, putting the RowMapper inside each domain object, and giving all of them a consistent name: public class ...
0
votes
1answer
314 views

MVP - Model Layer Architecture - Where and how to Setup Entities and DAO

I'm coding a "small" application using MVP pattern that gets it's data from a SQL database. I'm not using an ORM out of the box, and for the sake of learning, I'm writing my own simple ORM/DAO type ...
0
votes
1answer
323 views

Data Mapper Pattern and DDD - Does ist already reflect domain entities and repositories?

I'm getting used to DDD so don't assume I'm a DDD pro yet. I'm trying to implement a hexagonal architecture using the CakePHP framework in a completely custom made application that just utilizes the ...
5
votes
2answers
326 views

Domain Model Representation - Formal ontology vs code

Disclaimer: I have limited experience building domain models, this is purely asked out of interest to those who do I have recently stumbled upon the concept of representing data models with ...
1
vote
1answer
185 views

Authorization and Domain Model

I have an enterprise system that is represented by a domain model, part of the requirement that the system should limit access to some of the features based on privileges of the logged in user. ...
4
votes
1answer
258 views

DDD: How to work with entity variations?

Let's say I have an Entity that represents an employee: Employee First name Last name Birthdate Hair color Eye color Gender .... (and so on) Now, imagine I have a website ...
5
votes
1answer
947 views

DDD - How to avoid overlapping aggregate boundaries?

I recently started reading Evan's book about DDD, and I decided to try and apply some of the principles from that book on a bounded context of a project I've been working on. The context of interest ...
2
votes
1answer
444 views

DDD: Should create domain model for complex application layer?

I'm midway through Eric Evans' DDD book but don't think this question would be answered in the book. If an application has its own complicated concepts different from the underlying domain, can we ...
3
votes
1answer
94 views

Modelling the domain

I am working on the domain model of an application that stores information provided by sellers about the goods they sell on a platform. The application just acts as a data store for this information. ...
3
votes
3answers
373 views

Is an Enum changing the behaviour of an Entity bad?

I am very new to Domain-Driven Design. I have come across a part of a domain which I'm not sure if I have modeled in the best way possible. There is a Membership entity which has a membership type. ...
2
votes
1answer
454 views

How are CQRS write models initially populated?

I have a system that interacts with a REST API as the data source. This system is based on DDD and all of my current models are CRUD models. There is one model that the REST API is only able to query ...
0
votes
3answers
167 views

Handling inconsistent state of domain objects

In general, I would my domain objects (customer, contract, etc.) to be always in a consistent state. However there are situations, where they might be in an inconsistent state, and nevertheless I want ...
2
votes
1answer
43 views

Advice on AggregateRoot boundaries

I am confused on how to apply DDD principles for the design of domain entity clusters with Aggregate Root. According to my understanding, Aggregate Root enforces business validations and all entities ...
3
votes
1answer
219 views

How can I appropriately model relationships that have a cyclical dependency?

Let's take two simple Rails models, Post and PostRevision. class Post < ApplicationRecord # Attribute: Status (ex: draft, public, private, deleted) # Attribute: Views # An owner, likely a ...
2
votes
3answers
1k views

Who owns the Orders in a consumer-provider marketplace like platform?

We are developing an application where providers can offer their products and consumers can buy them (sort of marketplace). We try to apply DDD concepts into our model design and the implementation ...
1
vote
2answers
185 views

Naming relationship aggregates

Sometimes it is pretty easy to find very natural concept to represent relationship, for example Person and Team can be connected by Membership, but occasionally it is not so easy and the concept might ...
1
vote
2answers
856 views

What is data persistence in the context of software engineering?

I imagine it is simply, as it is named, the existence of data throughout layers of a software application. I ask because I have not been able to find a clear definition that states something of the ...
4
votes
1answer
287 views

Where does business logic go that involves multiple aggregates?

I'm still a beginner when it comes to domain driven design, and I am trying to model something like an RPG's battle system as a bounded context. I am trying to model a bounded context in which a ...
22
votes
8answers
5k views

When is primitive obsession not a code smell?

I have read plenty of articles recently that describe primitive obsession as a code smell. There are two benefits of avoiding primitive obsession: It makes the domain model more explicit. For ...
0
votes
0answers
345 views

What is the cleanest way to model my domain in JavaScript?

I am building an SPA. It will use WebGL, Canvas and SVG for certain components, and html for rendering views. I have a messaging system setup to define messages coming from a server, which will get ...
1
vote
0answers
56 views

Is it okay to have an asymmetric relationship between entities in a JavaEE data model?

I'm having difficulties assessing a design decision regarding entity relations in a JavaEE persistence data model. Let's say I want to design a simple data model that's supposed to represent a ...
0
votes
1answer
219 views

How deep should we explore domain (subdomain, bounded context) in Domain Driven Design?

I am curious about your approaches/heuristics to the exploration of domain (subdomain, bounded context) during DDD modeling session. As everyone knows most of programmers tend to be perfectionists (...
3
votes
2answers
883 views

DDD: must all Aggregates model relationships, or they can be “shallow”?

Sometimes my Aggregate will be very simple; some scenarios are simply not complex enough to require deep trees of objects and relations. Consider a Website Monitoring application, which periodically ...
3
votes
2answers
158 views

When to use a repository/service vs an instance variable?

When does an object truly belong to a class? I'm familiar with the "has-a" relationship, but in the case of an Employee object, it "has-a" 401k, but it's not really composed of a 401k object. As an ...
2
votes
1answer
72 views

Cross Entity Action Implementation

I have a domain layer, which my application architecture holds "sacred"; that is to say, the domain layer has no references to either data storage, or presentation concerns (vice-versa is allowed). I ...
5
votes
1answer
208 views

Where to add the role based access logic in domain model aspects? For Library Management System

The biggest difficulty I am having is finding where to house the responsibilities of each object identified by me in the system( say on problem space). I am posting a very simplified description of a ...