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

learn more… | top users | synonyms

46
votes
20answers
3k 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 ...
46
votes
5answers
6k 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 ...
35
votes
15answers
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 ...
16
votes
6answers
2k 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 ...
10
votes
3answers
1k 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 ...
9
votes
3answers
785 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, ...
8
votes
1answer
469 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 ...
7
votes
4answers
2k 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 ...
7
votes
1answer
937 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 ...
7
votes
1answer
353 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, ...
6
votes
3answers
4k 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 ...
6
votes
2answers
353 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 ...
6
votes
3answers
449 views

Resources for popular domain models [closed]

I have come across many situations where I had to build a system for a library or a clinic or other popular domains. The thing is a domain model for a library was probably done 1000 times already with ...
6
votes
3answers
210 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 ...
5
votes
6answers
509 views

Should a domain expert make class diagrams?

The domain expert in our team uses UML class diagrams to model the domain model. As a result, the class diagrams are more of technical models rather than domain models (it serves of some sort of ...
5
votes
3answers
243 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 ...
5
votes
2answers
1k 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 ...
5
votes
1answer
214 views

Integrating Domain Model Applications - Resources/Guidance

I'm struggling to find guidance on integrating various applications, usually based on a Domain Model architecture. The applications often expose and consume each others WCF services, but this tends to ...
4
votes
4answers
146 views

Most logically consistent way to create methods of the form a affects b?

I have a common scenario where I have an object (a) that logically affects another object (b), like a makes a note on b, or a marks b as disabled (usually a is a user object of the system and b is ...
4
votes
2answers
490 views

ORM domain design pitfalls

Are there any patterns which seem sensible when designing an object oriented domain, but do not translate nicely onto a relational database schema? If so, are there standard patterns that can be used ...
4
votes
2answers
338 views

How should I include third-party models in my domain model?

I'm currently trying to design a little application using Domain Driven Design but I'm afraid I don't really get the concept yet. Let me try to explain this as clearly as possible. public interface ...
4
votes
3answers
335 views

Architecting multi-model multi-DB ASP.NET MVC solution

I have an ASP.NET MVC 4 solution that I'm putting together, leveraging IoC and the repository pattern using Entity Framework 5. I have a new requirement to be able to pull data from a second database ...
4
votes
2answers
632 views

Justification for bidirectional relationship

I typically try and avoid bidirectional relationships at all costs. Recently I've been trying to follow a more domain centric design philosophy and I'm looking for advice in the best way to solve a ...
4
votes
3answers
370 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 ...
4
votes
1answer
58 views

How to model and query spatial responsibilites of company local branches

what are best practices, to model and query spatial responsibilities of company local branches? My company has many local branches which are all in general responsible for 1 city. This is the easiest ...
3
votes
2answers
305 views

Single Responsibility principle VS KISS principle

Let's assume the modeling of User model in a context of a social network. User concept is composed of two notions: Authentication elements like userName/Password/Email etc... Extra data information ...
3
votes
3answers
1k views

How do we handle Categories in database schema and model classes

I am trying to develop an ecommerce solution but stuck on the categories management issue and don't know how to proceed further. See, A category will have a parent category, which in-return can also ...
3
votes
2answers
868 views

Validation and data persistence in a domain model

My (first and current) workplace (a .NET shop) suffers from an over-abundance of anemic domain models, to the extent that I don't really know how validation and data persistence should be handled in a ...
3
votes
1answer
38 views

Dealing with Users and User-Owned Data in an API

I have a question about the way I am architecting an API. Structure My API structure so far is like so (there is about 10 classes total, but many are similar, so I've reduced to these classes, and ...
3
votes
2answers
420 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 ...
3
votes
2answers
349 views

Developing the Domain Model alone

In DDD examples it seems the common method for developing the domain model is to sit with domain experts and iterate over versions of the model, say on a whiteboard, continually modifying it and ...
3
votes
1answer
76 views

Is there any scenario where it's useful to keep mutable properties cached in domain objects for anything else than informational purposes?

Usually in a domain model, you'll have objects, and those objects will have properties that are mutable and properties that are immutable - for instance, a instance id/name will be immutable, while ...
3
votes
1answer
706 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 ...
3
votes
1answer
119 views

Representing domain objects

This is related to my recent question regarding naming awkward domain objects. A number of answers indicated I was using the wrong representation for the domain objects. To summarize, I chose to use ...
3
votes
2answers
557 views

Can the following Domain Entity contain logic for creating/deleting other entities?

a) As far as I understand it, in most cases Domain Model DM doesn't contain code for creating/deleting domain entities, but instead it is the job of layers ( ie service layer or UI layer ) on top of ...
3
votes
1answer
157 views

Data/Object Design Problem

Goal: I'm trying to figure out the best way to model/design and then implement a "user" feature in a system. Background: I am designing an on-line access request system, so our company can use a ...
3
votes
3answers
228 views

What are the pros and cons of implementing this requirement in different layers?

I have a CRUD app for <DomainObject>s. They are persisted in a database. There is a new requirement: keep track of the <DomainObject>s that have been created since the app was opened, ...
3
votes
1answer
347 views

modelling a restaurant availability search

I am looking into finding an efficient way which can scale up to thousands of restaurants, for doing a reservation search. Ideally, it would be efficient to answer queries like find a restaurant ...
3
votes
1answer
672 views

Domain Models (PHP)

I have been programming in PHP for several years and have, in the past, adopted methods of my own to handle data within my applications. I have built my own MVC, in the past, and have a reasonable ...
3
votes
2answers
82 views

Resources on securing domain models? [closed]

I'm have good resources on both security, domain modelling, and architecture patterns. I've noticed a distinct lack of any suggestion of how and where to integrate security into the systems I build. I ...
2
votes
3answers
197 views

Should data models know where / how they're stored?

I have some classes that represent, for the most part, data that's deserialized from XML. They also have some behavior in them, because I don't want to suffer from an anemic domain model. These domain ...
2
votes
2answers
103 views

How to deal with data on the model specific to the technology being used?

There are some cases where some of the data on a class of the domain model of an application seems to be dependent on the technology being used. One example of this is the following: suppose we are ...
2
votes
1answer
1k views

Do MVC web frameworks favor anemic domain model in order to avoid duplication?

Binding directly the form to your model helps a lot to get rid of boiler plate code, but that means that your model must have a getter/setter for each property otherwise it wouldn't be possible. ...
2
votes
2answers
149 views

Rich domain model and container services

I have a long experience in programming Java EE projects, but as I noticed most of the job I have done was with Transaction Script (anti)pattern. So I want to learn using a rich domain model, but ...
2
votes
1answer
111 views

How to present domain model exceptions thrown through validation

In domain model of my web application I've an entity Foo which can be created only by a pojo FooBean: Foo.newInstance(FooBean fooBean) (Might have been better a Builder-pattern.) In the factory ...
2
votes
3answers
232 views

Should POCO domain classes contain collections?

The question title is not good, but I couldn't think of a way to word it better. I am used to develop using POCO classes in my projects, that is, domain objects contain absolutely no logic, only ...
2
votes
2answers
167 views

Choosing an ubiquitous language across different bounded contexts

If my domain has several Bounded Contexts, but only ONE team will work on all contexts, should I develop an Ubiquitous language for each context? or should I have only one and force to into all ...
2
votes
1answer
95 views

Way to allow inspection of java data model after exporting to file

I've refactored a program to remove its dependency on an sql database by storing all the state in a memory model. However the manager liked the ability to easily inspect the domain state just by ...
2
votes
2answers
60 views

Should I use structure from a core library graphic toolkit in my domain?

In java (and many other programming language), there are often structure to deal with graphic element : Colour, Shape, etc. Those are most often in a UI toolkit and thus have a relatively strong ...
2
votes
1answer
312 views

Should the domain model include all the domain entities in my project?

I have currently reading Grails and I love it. In order to get hands on experience with Grails I decided to create a web application for some Management System. Ya as you can guess there are plenty of ...