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

0
votes
1answer
69 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
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 ...
1
vote
1answer
100 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
42 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
64 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
72 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
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 ...
6
votes
3answers
211 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 ...
0
votes
1answer
62 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
171 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
154 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
70 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
164 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
173 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
111 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 ...
1
vote
1answer
99 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 ...
1
vote
3answers
170 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 ...
0
votes
2answers
383 views

DTO - service layer - statelessness best practices interfering with each other

I am designing a REST API coupled with a service layer that takes DTOs as input and produces them as output. This works fine for most service calls where the DTO is used to access an underlying ...
0
votes
0answers
62 views

Building simulation architectures : Which one to choose?

I am writing a simulation which unites discrete event and continuous system simulation. For example, you can use State Charts, System Dynamics and Queues side by side. Theese will then reduced to ...
0
votes
1answer
163 views

Technical example of modeling a domain with OOD?

Considering favoring composition over inheritance and looking at various design patterns there are multiple approaches to modeling a domain. Say you have some Entities which are very similar in some ...
1
vote
1answer
205 views

How do you handle domain logic that spans multiple model objects in an ORM?

So I know that business logic should be placed in the model. But using an ORM it is not as clear where I should place code that handles multiple objects. E.g. let's say we have a Customer model which ...
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
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
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 ...
0
votes
0answers
28 views

Domain security involving domain logic

Together with my application's domain logic I am trying to outline the security model. I am stuck with a requirement that prevents me from considering security just a cross-cutting concern over my ...
1
vote
1answer
143 views

Cascading deletes from an aggregate root through out the entire aggregate doesn't make sense

Based on the same example for this question. Within the Pro ASP.Net MVC 4 by Adam Freeman, there is a discussion on aggregates and aggregate roots with a simple auction system. There are members who ...
1
vote
1answer
240 views

DDD - Business rule that depends on a service

I got confused about if a domain is required to access an external service in some state of it's life cycle. The business rule is this : If an Employee is accepting a JobSeeker's JobApplication, ...
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 ...
1
vote
2answers
302 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 ...
0
votes
0answers
39 views

Functional tests only to testing the infrastructure layer, or test too the domain services without mocking?

This is a code example: My entities (Domain Layer): class Account: def __init__(name, author): self.name = name self.email = email My repositories interfaces (Domain Layer): ...
1
vote
0answers
81 views

Rails: get data about a model collection, with new model or method?

have a model Product with attributes sales, views and I need to get sales/views count of all products, in this case is more correct to implement this things as method and have a call like ...
1
vote
4answers
272 views

In MV* pattern where does non-business model goes?

I am passing Menu items to View from ViewModel. My menu definition is a model with properties title, image, hasChildren and isEnabled. But this model is meant for UI unlike business domain models like ...
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 ...
0
votes
2answers
273 views

How do I make a domain model that doesn't violate OOP?

My game reads a number of JSON files, deserializes them, and hands the resulting objects off to the classes that need them. These deserialized objects, which can be thought of as the domain model, are ...
3
votes
1answer
709 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 ...
2
votes
2answers
136 views

Handling “unspecified” values in software

So I'm working on a software product where we have a number of fields that the customer can leave blank, some of which are numeric. To persist these in the database we use nullable columns. Easy ...
0
votes
0answers
93 views

Model Driven Design with Bean Validation

If I have a rich domain library that gets included into a Java web application, but I want to achieve a level of dependency isolation with that domain library such that it is possible to build and ...
0
votes
2answers
115 views

How does one design his various architecture/business models?

I'm currently learning about various application design approaches and there's one thing I can't really get my head around. Let's say I have a physical device in my network, an IP surveillance ...
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 ...
1
vote
0answers
81 views

How to isolate a massive and changeable web service [duplicate]

I am trying to come up with a way to wrap a very large web service that changes very frequently. There are 400+ types and each type has 20 to 300 attributes. The service is a SalesForce.com ...
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 ...
0
votes
1answer
162 views

Why aren't Entities allowed to reference other entities inside an aggregate except the root?

I have read in several places this following rule concerning Aggregates: Entities in one aggregate can hold references to any other Aggregate Root, but never to an Entity or Value Object inside ...
0
votes
1answer
154 views

Several interdependent models, each with several data sources — how to avoid hell and nightmare

I'm currently working on a project that requires a complicated model structure and I'm struggling with picking the right architecture. First of all, there are several interdependent models. Change in ...
0
votes
1answer
117 views

Aggregate Boundary repository/service design

I am trying to apply DDD to the design of a Release Management system. Domain Entities Project: The project/product/system. ProjectEnvironment: The environments (Test, Staging, Prod) that exist ...
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 ...
1
vote
1answer
390 views

Web application / Domain model integration using JSON capable DTOs

I'm a bit confused about architectural choices for the web-applications/java/python world. For c/c++ world the available (open source) choices to implement web applications is pretty limited to zero, ...
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 ...
0
votes
1answer
855 views

How do you formulate the Domain Model in Domain Driven Design properly (Bounded Contexts, Domains)?

Say you have a few applications which deal with a few different Core Domains. The examples are made up and it's hard to put a real example with meaningful data together (concisely). In Domain Driven ...
4
votes
3answers
336 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 ...
3
votes
2answers
870 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 ...