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
118 votes
6 answers
33k 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?
Michael Haddad's user avatar
103 votes
5 answers
15k views

With all of these services, how can I not be anemic?

Where do we draw the line between delegation and encapsulation of business logic? It seems to me that the more we delegate, the more anemic we become. However, delegation also promotes reuse and the ...
SonOfPirate's user avatar
  • 2,915
56 votes
20 answers
9k views

Must developers understand the business domain or should the specification be sufficient?

I work for a company for which the domain is really difficult to understand because it is high technology in electronics, but this is applicable to any software development in a complex domain. The ...
50 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 {...
Octavian Niculescu's user avatar
38 votes
7 answers
14k views

Modeling first and lastname separately

Which arguments should someone consider when designing a new system and has to either store the name of a person as one field or separately as first/last name? Pros for single field: Simpler UI No ...
Istvan Devai's user avatar
37 votes
7 answers
10k views

Do RESTful APIs tend to encourage anemic domain models?

I'm working on a project in which we are trying to apply both domain-driven design and REST to a service-oriented architecture. We aren't worrying about 100% REST compliance; it would probably be ...
Kazark's user avatar
  • 1,810
33 votes
15 answers
2k views

Saying "no" to people asking questions [duplicate]

Possible Duplicate: When do you not give help to less experienced programmers? Currently, I am finding a lot of my day is taken up by people asking domain knowledge/system questions. This ...
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 ...
George Z.'s user avatar
  • 705
29 votes
4 answers
8k 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 ...
NaN's user avatar
  • 549
29 votes
9 answers
11k 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 ...
w0051977's user avatar
  • 7,081
21 votes
4 answers
15k views

Clean architecture validation in domain vs data persistence layer?

I'm studying up on clean and as a result am quite dramatically rethinking a great deal of how I design and write software. I've thing I'm still wrestling with however, is for business rules like "on ...
Dale Holborow's user avatar
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. ...
Alexander Petrov's user avatar
18 votes
6 answers
17k views

DDD Injecting Services on Entity Methods Calls

Short format of question Is it within best practices of DDD and OOP to inject services on entity method calls? Long format example Let's say we have the classic Order-LineItems case in DDD, where ...
e_i_pi's user avatar
  • 859
16 votes
5 answers
16k views

Find the DDD Aggregate Root

Let's play everyone's favorite game, find the Aggregrate Root. Let's use the canonical Customer/Order/OrderLines/Product problem domain. Traditionally, Customer, order, and product are the AR's with ...
Darthg8r's user avatar
  • 267
16 votes
3 answers
4k views

Are Domain Objects in Domain Driven Design only supposed to be write-only?

I've been reading about Domain Driven Design for almost two years and have been cautiously been introducing some concepts in to my daily work or at least making plans for how things I do regularly ...
jpierson's user avatar
  • 301
16 votes
2 answers
4k 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 ...
Double M's user avatar
  • 446
15 votes
4 answers
3k views

Should entities contain information about their amount?

Can I get some thoughts on the entity design? Let's say I have an entity called Book. Let's say I create a specific instance of that book. It has a title A and an author B. Since there can be multiple ...
Kleronomas's user avatar
15 votes
4 answers
9k views

Accessing Repositories from Domain

Say we have a task logging system, when a task is logged, the user specifies a category and the task defaults to a status of 'Outstanding'. Assume in this instance that Category and Status have to be ...
Paul T Davies's user avatar
14 votes
4 answers
15k views

Domain Driven Design and Cross Domain interaction

I am a relative DDD newbie, but I am reading anything and everything I can get my hands on to boil out and distill my knowledge. I came across this DDD question, and one of the answers has me ...
PaulAdvancedUk's user avatar
13 votes
5 answers
4k 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 ...
Ted Chirvasiu's user avatar
12 votes
1 answer
987 views

Do ORM POCOs replace domain entities?

This is somewhat similar to this question but more broad. In general, with ORMs like EF 4.1 supporting POCOs, does it now make sense to have your domain entities be the objects that are persisted to ...
Adam Rackis's user avatar
12 votes
2 answers
3k views

Are Persistence-Ignorant objects able to implement lazy loading?

Persistence Ignorance is an application of single responsibility principle, which in practice means that Domain Objects (DO) shouldn't contain code related to persistence, instead they should only ...
user1483278's user avatar
  • 1,131
11 votes
3 answers
8k views

DDD with ORM where should the business logic go?

I have used an MDA (model driven architecture) tool in the past where we modeled via UML and this generated the business entities (our domain model) and the ORM (mapping etc) amongst other things. A ...
JD01's user avatar
  • 1,289
11 votes
3 answers
3k views

Entity Framework and avoiding the Anemic Domain Model

In our business logic we occasionally have methods defined something like this: User.ResetCourse(Course courseToReset) The problem is that both User and Course are Entity Framework proxy objects. ...
Calin Leafshade's user avatar
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 ...
François Beausoleil's user avatar
10 votes
2 answers
544 views

Should well-known business ID of an entity be represented with a dedicated type in DDD/OOP?

In practical terms it means using an custom (immutable) class over a string or some other primitive type. Examples: Publishing: International Standard Book Number. Finance: International Securities ...
Den's user avatar
  • 4,847
10 votes
2 answers
5k 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 ...
fj123x's user avatar
  • 209
10 votes
4 answers
3k views

Lookup Tables: Are they a leak in the domain model?

You are building a system that keeps track of Companies. Those companies have Contacts. Those contacts are often specialists that only answer certain types of questions, such as Billing/Payment, Sales,...
Drew's user avatar
  • 221
10 votes
1 answer
5k views

Clean architecture: should users go in the use case layer or the domain layer?

I recently read this article about Clean Architecture, as I'm trying to get out of some usual OO habits (interface design everywhere, but what does it do???), and program something that describes what ...
Adam 's user avatar
  • 1,387
10 votes
4 answers
4k views

Model relationships with DDD (or with sense)?

Here is a simplified requirement: User creates a Question with multiple Answers. Question must have at least one Answer. Clarification: think Question and Answer as in a test: there is one ...
lawpert's user avatar
  • 836
10 votes
1 answer
766 views

Does current evidence support the adoption of Contextual over Canonical Data Models?

The "canonical" idea is pervasive in software; patterns like Canonical Model, Canonical Schema, Canonical Data Model and so on, seem to come up again and again in development. Like many developers, I'...
Aaronaught's user avatar
  • 44.3k
10 votes
4 answers
6k views

Ensuring transactional consistency with DDD

I am starting out with DDD and understand that aggregate roots are used to ensure transnational consistency. We should not modify multiple aggregates in one application service. I would like to know ...
morleyc's user avatar
  • 345
9 votes
4 answers
13k views

ID properties on Domain objects in DDD

In my domain I have an Account object. e.g. class Account { public string Number; public string SortCode; } Within the context of DDD, should this account object have an ID property? The ID ...
BanksySan's user avatar
  • 724
9 votes
3 answers
1k views

What is the object-oriented thought process? [closed]

I've been studying OOP in conjunction with Zend's MVC implementation for the past few months. I'm pretty new to programming, generally, but I feel strongly that I should learn things the 'right' way, ...
user avatar
9 votes
2 answers
3k views

Exposing domain models over API

I'm building a simple RESTful API for a web-based application I'm working on, and I'm wondering about the best way to go about exposing my domain models. Let's say I have a User class and I want to ...
James's user avatar
  • 225
9 votes
4 answers
5k views

Should Exceptions Be Expressed on the Domain Model?

Let's say that we have a class PersonName and we throw an exception when some one try to create a instance of PersonName passing an invalid name to the constructor. Should the exception ...
Lucas Piske's user avatar
9 votes
2 answers
9k views

Could REST api be considered as a presentation layer in DDD?

I read a lot of questions about this concern, and some of them are Presentation VS Application layer in DDD Application layer vs domain layer? So my question is if the top layer is REST API and ...
Dario Granich's user avatar
9 votes
1 answer
1k 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/...
Dariusz Mydlarz's user avatar
8 votes
1 answer
2k views

Definition of a 3-tier system

People often claim that they are following a '3-tier (or n-tier) architecture', and sometimes they then claim to be switching to a Domain Model. But I really never have understood what this mythical '...
Paul T Davies's user avatar
8 votes
3 answers
3k views

In domain driven design, how do I convert a database table with a primary key into a Value Object?

Lets suppose there's a database schema defined like this: Person.mail_address_key ----- Address.address_key Person.billing_address_key ----- Address.address_key A Person has a mailing address and a ...
Daniel Kaplan's user avatar
8 votes
1 answer
6k views

DDD: Domain Model Factory Design

I am trying to understand how and where to implement domain model factories. I have included my Company aggregate as a demo of how I have done it. I have included my design decisions at the end - I ...
Dave New's user avatar
  • 897
7 votes
3 answers
6k views

Who are the domain experts?

In Domain-Driven Design much is said about the domain experts. They are the ones who knows about the domain, and which should be in contact with the developer in order to build the ubiquitous language ...
user1620696's user avatar
  • 4,867
7 votes
3 answers
5k views

Does reference by ID between Aggregates lead to an Anemic Domain Model?

Overview I'm trying to wrap my head around the best-practice way to link Aggregate Roots together without transferring a lot of the business logic from the Entities/AR's themselves to Services, all ...
nicholaswmin's user avatar
  • 1,870
7 votes
3 answers
13k 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 ...
Steve's user avatar
  • 299
7 votes
2 answers
1k 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 ...
Josh Taylor's user avatar
7 votes
2 answers
2k views

Can readmodel and writemodel inherit from Model for fields in DDD + CQRS?

I'm new to DDD + CQRS, and I'm working in a project that has this implemented, but I wonder why the guy duplicates the models. I understand, that one is for writing (commands) and one is for reading, ...
JorgeeFG's user avatar
  • 669
7 votes
2 answers
5k 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, ...
ExcellentAverage's user avatar
7 votes
1 answer
432 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 ...
Yola's user avatar
  • 221
7 votes
1 answer
3k 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 ...
Stefan Rendevski's user avatar
7 votes
2 answers
1k views

How far to go with Domain Driven Design?

I've read a little about domain driven design and the usage of a rich domain model, as described by Martin Fowler, and I've decided to put it in practice in a personal project, instead of using ...
synti's user avatar
  • 73

1
2 3 4 5
7