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
4
votes
2answers
423 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 ...
2
votes
3answers
204 views

In domain driven design, is a timestamp a property or a value object?

I have some entities and some value objects that need to record the moment they were made. Now I read that a value object is a collection of properties with its own set of rules, and two value objects ...
1
vote
1answer
83 views

Loan Amortization Schedule - Precision and rounding

I have been playing around making amortization schedules in PHP. My php.ini currently has the precision set to 14. I understand going into this that there will be rounding errors however I am hoping ...
2
votes
3answers
126 views

Modeling different types of “Posts”

I have different types of posts a user can create: TextPost ImagePost VideoPost The frontend client needs to retrieve the last 10 posts from a user. I am wondering how to model this structure ...
4
votes
3answers
269 views

How should I go about naming when modeling a sport that can be between either individuals or teams?

Tennis is played as singles or doubles. I considered making my tennis scoring model logic refer to "teams" throughout its naming since "player" wouldn't take into account doubles. However, seeing ...
1
vote
1answer
82 views

API design for data model with frequent field name updates

I have an external data model framework with frequent updates to the names of fields. Say for an iteration I implement on - EnterpriseModelObject -- EnterpriseDomainContentList --- ...
1
vote
2answers
97 views

What is a good domain model in this case?

I have a grid of values, something like [ [0,3,1], [0,2,5], [1,0,3], ] I have objects that move on that grid, so they have positions { x: 1.87, y: 1.21 } If we check the upper ...
0
votes
0answers
23 views

Import many data using dto between multiple modules

I am working on a symfony application where i have complex user data coming through an external json feed. This data is usually a 100MB json feed from which i have to read user data (with all its more ...
1
vote
2answers
93 views

Need good design: Anemic Model, Inheritance and Pattern Matching

I have Handler classes which accepts Queries and returns Results. Handlers is anemic. They accept input data bag and returns output data bag. Handlers can be many so I created common generic interface ...
2
votes
2answers
117 views

Different types of account transactions

I'm working on a system where users have different types of 'Accounts' of the financial type. I'm struggling to come up with a design that works. Background A user has 2 types of accounts: A 'tab' ...
-1
votes
1answer
44 views

Software Architecture - Defining an extension in a domain model

If you had a domain model like this one: How would you define an extension (something that would only happen as an exception)? Do you draw a box around it like you do in a e.g. a sequence diagram?
2
votes
3answers
177 views

DataAccess Layer coupling with Domain Layer

We have an issue with how the implementation of the Data Access layer (EF6 Includes more specifically), influences the behavior of our Domain layer. A theoretical example to illustrate: Application ...
0
votes
2answers
212 views

Object and actors in sequence diagram [duplicate]

question Can an actor "talk" directly with an object of the system in a sequence? example For an homework I need to model a "tracking service" for some shipping company. The functional requisites ...
1
vote
1answer
90 views

Domain Driven Design - Bi Directional association between aggregates

I've been struggling with modeling something out correctly, the DDD way. The use case is quite simple. You're a User, and you can be part of a Group. So we have a 1 - many between group and users ( ...
1
vote
1answer
87 views

DDD - Hardcoded Ids in Domain Model [closed]

I have a Business Layer, where I have put all the Entities of the Domain Model. Also there are Domain Services, where I put Domain Logic related to n Entities. One entity is : public class ...
2
votes
1answer
116 views

Is making your ORM DAO a subclass of your Domain Model object a viable strategy?

I am trying to separate my domain model and associated business logic from my persistence model, particularly such that the domain model has no dependency on the ORM. One apparent way to do that was ...
0
votes
1answer
295 views

Domain Driven Design // Navigation Properties and Aggregate

I'm currently making a REST API, using DDD. As ORM i use Entity Framework Core, this ORM has easy mappings for navigation properties, as you sure are familiar with. My question is about navigation ...
2
votes
1answer
135 views

DDD - how to model an aggregate using data from 2 other aggregates to make a business decision

I'm stumbling trying to find a proper way to model this scenario: I have 3 different aggregates within same Bounded Context: A Student A University A University of Interest public class Student : ...
6
votes
2answers
202 views

In Hexagonal Architecture, can a UseCase call another UseCase?

My layers are like: Controller (Http) -> Use Case -> Domain Services Imagine that I have a PurchaseController which is just getting the parameters from the Http Request and calling the ...
0
votes
0answers
28 views

Modelling device-oriented domain

My application is connected to several hardware devices, where as for each device, there is a dedicated device client containing it's own representation of the device protocol, response/request or ...
0
votes
3answers
299 views

Domain Models with complex properties construction

According to this article: Using Ids in Domain Models is not a good practice. We should reference the entire domain model instead. In this case, when we want to provide only Getters for our ...
1
vote
2answers
124 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
271 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
432 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
150 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
149 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
143 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
218 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
290 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
56 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
68 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
6k 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
236 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
93 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 ...
10
votes
2answers
1k 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
125 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
26 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
1k 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 ...
2
votes
1answer
2k 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 (...
0
votes
1answer
871 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
186 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
157 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
292 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 ...
2
votes
2answers
504 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
256 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
368 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
413 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
470 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 ...
6
votes
2answers
463 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
278 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. ...