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-model]

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

0
votes
1answer
43 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 ...
26
votes
4answers
4k 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 ...
0
votes
3answers
105 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
81 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
302 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 ...
-1
votes
1answer
96 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
22 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
132 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
232 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
195 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
176 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
88 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
80 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
205 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 ...
0
votes
2answers
77 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
86 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
243 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
201 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 ...
4
votes
2answers
223 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
113 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
183 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 ...
2
votes
1answer
475 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
267 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
90 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
273 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
361 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
117 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
34 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
181 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
504 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
115 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
398 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 ...
5
votes
1answer
236 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 ...
13
votes
6answers
2k 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
243 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
205 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
743 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
155 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
68 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
180 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 ...
-5
votes
1answer
180 views

Finding object relationships [closed]

Description Its a follow up question of writing use cases. Taking from nouns defined in my user story and requirement I found the following candidates to be classes: User Question Session Attempt/...
4
votes
1answer
409 views

DDD - Domain Modelling association between aggregates

I have a bit of a mental block when trying to model my scenario whilst practicing DDD. The problem appears to be around 2 entities you would consider to be aggregate roots. I feel these aggregate ...
-1
votes
1answer
806 views

Tender Type vs Payment Method/Type

I'm designing the data model of a payment database. One of the domain requirement is to keep track of how the customer paid and, if applicable, what was used i.e.: Visa, Amex, etc. In the past I ...
0
votes
2answers
342 views

Achieving “Persistence Ignorance” by having a persistence model separate from the domain model

I have recently come across the idea of persistence ignorance, the idea that your domain model should be ignorant of the persistence layer of the application, and that got me thinking. I have been ...
5
votes
1answer
112 views

Should data model logic live in database schema?

(Apologies if some of my terminology is off, I have not seen much on this subject and am using be best terms I could come up with) Should data model logic live in the database schema? I am making a ...
101
votes
6answers
14k views

What is a domain?

I see this term a lot in the context of software architecture ("domain-model", "domain-driven-design" etc.). I have googled it, but I get tons of different definitions. So what is it really?
5
votes
2answers
969 views

Domain Model Design - Best Practices for Robust Fluency, Encapsulation, and Extensibility

I am striving to have the most maintainable architecture possible in my application, but I cannot decide on a proper domain model design. Here is an example domain model for a user: public class ...
0
votes
1answer
870 views

Duplicating Domain Model in View Model or not

I have an XML file that contains configuration information for a system. I can serialize/deserialize the XML into a hierarchy of objects that describe the configuration (and no more) and then pass ...
0
votes
1answer
268 views

Correct way to inform business rules violation during JSON parsing

We have the following scenario in our company: There are some business objects which have business rules associated with them. One of these objects, Person, has the following rules: A Person must ...