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

3
votes
2answers
135 views

Ubiquitous language and maturity level in REST API?

According to Richardson Maturity Model there are several levels of maturity in REST approach. http://martinfowler.com/articles/richardsonMaturityModel.html Since DDD uses ubiquitous language, I am ...
2
votes
1answer
82 views

Design patterns to limit cross module logic

I have a web application which has a shopping cart with cart items. The cart items are added to the user session, so must be serializable. I have a checkout class which takes the cart items and saves ...
0
votes
0answers
34 views

Automated data processing in BPMN/BPEL?

In order to run complex simulations, I need to do preprocessing of data from various data sources. This is done by a bunch of Postgresql scripts. However, having only these is unsatisfactory, because ...
4
votes
4answers
141 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 ...
0
votes
0answers
60 views

How to prevent parallel calls to model?

While there is some command running which calls methods on some model, how to prevent concurrent calls for critical places in that model? If multiple requests comes in then they should maintain their ...
6
votes
3answers
303 views

Alternative to Anemic domain objects (Simple example provided)

I want to model (TV)Events and Reminders and I’m wondering what’s ‘the best’ way to model this. The requirements are roughly When an Event has no Reminder, a Reminder can be created When an Event ...
1
vote
3answers
150 views

When a class represents a property that might be invalid, how should the validation be done?

I have a Product class which has among others an attribute Ean13 that encapsulates an EAN13 code. Here is a prototype of the Product class: @Entity @Table(name = "tb_produtos") public class Product ...
3
votes
2answers
193 views

How to handle Data Fetching for Circular Object References in OOP Domain Models

I'm trying to put together some basic models in OOP (C#), and apparently I've got the wrong idea. If I have a Workman's Comp case, it is applied to a Patient. It also has one or more PatientVisits ...
0
votes
1answer
71 views

Should API DTOs be shaped to client(s) or be universal?

I have a project with an internal desktop client app and a server-side client API service talking to a relational database. I seem to have two choices: 1) shape DTOs to client views, e.g. ...
7
votes
4answers
298 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, ...
1
vote
2answers
112 views

What to do when hydrating whole domain model is unnecessary for concrete operation?

If some model can only exist if set of values are passed to it and validation on them are performed, then how to load such a model if only one of those values is needed for some action? It seems a ...
0
votes
1answer
282 views

Domain Model vs Presentation Model vs General Function

I have been building an app for my company i join for the past > 1 year, we're using Java Spring Hibernate Javascript jQuery Kendo UI And for the structure i can say something like this from ...
2
votes
1answer
165 views

TDD: How to test domain model

When practicing TDD, how do you test a domain model? If you don't test, how do you account for code coverage? We want to have 100% coverage (or as much as possible), but despite hours of training ...
4
votes
1answer
148 views

MVP / MVC role of the Model (not anemic one) clashes with presenter / controller role (responsibilities in the right place, Model OR Presenter)?

Problem? I have been looking at MVP implementation and process to design a good domain model (not anemic). It says that the domain model should have its own behavior and not being a simple data model ...
4
votes
3answers
184 views

DDD design question

I have a question on modelling an Entity\Aggregate root in DDD. I am refactoring a project that uses Entity Framework and business logic as services, the services contain lot of logic which I believe ...
9
votes
2answers
255 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 ...
4
votes
1answer
76 views

Should domain model be intelligent or there must be services, which operate it?

I'm building a web-app for a licensing service. My domain models are Licenses, and they can be of two types at the moment: server and client license. They are almost same, except server license has ...
4
votes
1answer
72 views

Strategy to define domain data used in Integration Tests

In my job we work in a data driven web application and performance is a important business feature. So, queries in the model tier are frequently large and contain much of the business logic. As a ...
2
votes
2answers
105 views

Authenticate in the Services? Or in an Endpoint that exposes the Services?

When I'm in charge, I typically model services separate from endpoints. For example: Company.Project.Domain.dll has all of the logic required to complete the services for that domain. In order to ...
0
votes
0answers
138 views

JavaFX Synchronize DataModel with Business Domain

I am currently working on a javaFX (first time) frontend for one of our applications. For this i'm using a simple MVC pattern where my model classes use properties so that i can directly bind them to ...
0
votes
0answers
56 views

Dealing with stale data / currency issues when lazy loading related entities

Imagine I have two associated domain entities with a one-to-many relationship. Here is an example with Customer and Order classes: public class Customer { public int ID { get; internal set; } ...
3
votes
2answers
248 views

Domain object model: query by id vs object

Let assume I have two simple model classes: Product and Brand It is obvious I have a query method in Product class like this Product product = Product.findById(123); What if, I want to query ...
2
votes
5answers
386 views

Should I use inheritance to differentiate objects even if they have the same fields?

Consider this simple class that models a real world mobile device: /// <summary> /// Model that represents a device. /// </summary> public class Device { public DateTime ...
4
votes
3answers
111 views

How do I model this relationship so that it is valid by construction?

Imagine a device class that represents a physical real world mobile device, with fields like Enabled, Platform, Model IMEI, etc. Then, an operation class, which is something that needs to be done to a ...
0
votes
2answers
222 views

Handling Business Logic/Validation Race Conditions

I'm working on a Training Enrollment web application with the following (simplified) features: Maintenance (Add, Edit, Deactivation) of Trainings Student sign-up Student enrollment to Active ...
1
vote
2answers
170 views

DDD using an ORM and a Active Directory Server for Persistence

With Domain Driven Design one would model out the domain. One would then use an ORM of some sort to take care of the persistence. Say you have a Product entity which has a Name, SKU and an Owner. This ...
1
vote
2answers
170 views

How can I create a model to efficiently answer the question of - where to place my db-interaction code I am about to write?

I am seeking the right model for storing and retrieving data, when working with any specific class, while keeping in mind the bigger picture. Details: I have some SQL code in (one) of my classes and ...
2
votes
4answers
150 views

Design ideas - validation based on conditions outside of the domain

I am facing a very interesting problem here, and I'd like to see some design ideas from domain driven design perspective. To make it easier to express what I need I have following hypothetical ...
1
vote
2answers
215 views

Implementing an anti-corruption layer with domain logic

I'm building an application that compiles a single PDF document from multiple source PDF documents as follows: it takes the first page of each source document, stamps certain information on top of ...
3
votes
2answers
82 views

Domain Modeling - Offerings vs. Usages

I have a question about an issue I always seem to run into when building a domain model. The issue comes up whenever a domain object is used in what I am calling an "offering" scenario and in a ...
0
votes
2answers
275 views

How to use DDD to solve a common address situation?

This is a simple example to show a situation that I find hard to solve with DDD. Consider this: - A property (e.g. a house) has an Address. - An address can be complete or partial (country only; ...
2
votes
2answers
117 views

Should ids be mapped to the implementation type

This is a question of model design, and hopefully some architecture nerds have strong opinions on this. I've been developing one that I will post in an answer. Typically, in every codebase I've ever ...
0
votes
1answer
285 views

Class Table Inheritance: do child tables need a primary key?

I'm using the Class Table Inheritance architecture with my application and have read Fowler. When mapping my database tables to classes in code, I've realized I have no need for an "ID" property on ...
0
votes
1answer
822 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 ...
3
votes
1answer
57 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 ...
1
vote
1answer
272 views

Help Improve DB model/strategy, for use in refactoring SQL-ridden legacy code

Question: Which design pattern do I use to help me refactor legacy SQL code into separate classes? Goal Bring in concepts of data separation and database separation and also latest modern ...
1
vote
1answer
47 views

Domain models with properties not always set

I don't know if to have domain models with properties that not always are set, it's a some kind of code smell or design error. I put an example: I have an app that lets read internet magazines using ...
2
votes
2answers
206 views

Domain/Model objects attributes good practices

Simple question: Should model/domain objects only include attributes that are meant to be persisted in a database or serialized to any other specific format? My understanding of a domain/model object ...
2
votes
1answer
154 views

DDD and edit of Aggregate's descendants

In a DDD approach, suppose I have an Order (this is my aggregate root) and a Line (a descendant of an Order). In both objects I have private setter for properties and a builder that handle creations ...
5
votes
3answers
527 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 ...
6
votes
3answers
607 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 ...
1
vote
1answer
193 views

DB modeling for staffing demand and supply

TL;DR - I'm looking for guidance with my database design. I am concerned that my existing design is inefficient and won't be able to handle large numbers of employees. This is going to be long, so ...
0
votes
2answers
251 views

Entity design for a blackjack game - should I make Card an entity?

I am creating a simple blackjack game backed by database In my Card is public class Card{ private Face face; private Suit suit; //setters.. getters } where face and suit are enums I have an ...
1
vote
4answers
221 views

Domain model associations that do not required the behaviour of the associated object. How to model?

I've been struggling with this question for a while. I'm specifically thinking within the object orientated domain model. Let's say I have two entities. A supplier and a customer. There is a ...
0
votes
1answer
76 views

Allow entities owned by one user to be referenced by other users' entities

I am working on an Asp.NET MVC web application. I have the following (simplified) entities: public class Course { public int Id { get; set; } public string Name { get; set; } public ...
0
votes
1answer
307 views

How do I keep my classes in MVC from becoming bloated?

I'm not sure how I should have worded the question. If I have a Student and Classes database, and I have queries that involve both. Where do I put my queries? In one case, someone wants student ...
1
vote
1answer
563 views

Domain model for a notification system

I'm trying to build a modular notification service in a ASP.NET MVC web application. The application generates notifications and the service is responsible for delivering the notifications to the ...
1
vote
1answer
153 views

Domain-specific Interfaces

Are there any real benefits of using interfaces over abstract classes in a domain model? Does anyone have any experience using interfaces in a domain model in a real project? From a technical ...
3
votes
2answers
429 views

Should a domain object wrap/contain a DTO interface?

Using .NET - I have an interface IPerson. This interface is implemented by classes in multiple, separate repositories, e.g. EF6 (EfPerson), custom SQL (SqlPerson), or even custom assembly connecting ...
2
votes
3answers
565 views

“Cross-cutting” domain in DDD

I've recently started studying Domain Driven Design and so far it looks like it will help tremendously with my team's current project. I'm running into a bit of a problem though actually determining ...