Questions tagged [domain-objects]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
66 views

How to structure a cart with cart products object

I am new to DDD and I am having trouble structuring an object. I have a cart, where I can add products to it. Each product has some properties like image, title, price, etc. Whenever a product is ...
Bernardo Benini Fantin's user avatar
0 votes
0 answers
119 views

Interfaces vs abstract classes for immutable DTOs

At my org we extensively use @Value.Immutable annotation to generate Immutable classes (usually with builders) for our internal data transfer objects (DTOs). In our codebase I've seen both interfaces ...
y2k-shubham's user avatar
3 votes
2 answers
252 views

Should I save my entire domain object or update individual properties?

Scenario: An application is going to perform operations on an entity. That means retrieving it from storage, possibly making modifications, and then persisting those changes back to storage. I'm ...
Scott Hannen's user avatar
1 vote
1 answer
927 views

DDD: Can application services throw domain errors?

I'm new to DDD and I trying to create an API using DDD concepts for study purposes. Today, I faced a scenario where I've to create an Application Service to expose a functionality to be cosumed from ...
Gabriel Morishita's user avatar
0 votes
0 answers
75 views

Allowing an invalid state before an entity creation process is completed?

A lot of sites will save the progress of the creation of an entity or some process. For example, stackoverflow will allow you to draft a question before you post it. If StackOverflow used DDD, I would ...
Patrick Christie's user avatar
2 votes
0 answers
721 views

Clean Architecture, what are objects that does not completely fit as entities?

I'm reading chapter 20, "Business Rules", of clean architecture book, in this chapter Uncle Bob defines entities as: An Entity is an object within our computer system that embodies a small ...
Thiago Dias's user avatar
0 votes
1 answer
546 views

Best practice to create model objects in Java

I have an existing microservice that talks to a Natural Language Processing (NLP) product and fetches around 50 fields. I need to create domain objects in Java now from these fields. I read about ...
Akash Sharma's user avatar
1 vote
3 answers
539 views

How to model and unit test code with multiple side effects?

How to unit test code that requires multiple side effects? For example, making an invoice. Simple action requires few thing to happen simultaneously: create invoice in db send invoice to backend ...
daneejela's user avatar
  • 201
4 votes
3 answers
974 views

Should the DTO be able to parse itself from and to Domain?

Let's say there's the class Book, with different models in different endpoints: Endpoint A (consumer): class Book{ Map<string,string> chapterName_content } Endpoint B (provider): class Book{ ...
Carlos Coelho's user avatar
2 votes
1 answer
220 views

How to model Business Objects depending on use cases?

I'm having trouble modeling the Business Objects of my application. In my domain I have substantially a list of bills of orders, and for every bill I have the pallet that contains the materials to ...
Ivan's user avatar
  • 69
1 vote
0 answers
252 views

Separating generated flatbuffer/protobuf files from domain model - best practices

I'm using flatbuffers for the first time. I've generated my java classes and have tested out serializing / deserializaing a message. Now I'm thinking about how to integrate these in to my JavaFx and ...
Stealth Rabbi's user avatar
1 vote
2 answers
93 views

What's the best convention to store "other" option?

Say I have a Person object. I need to ask the user to choose from a list, which laptop they have. They can also choose the option "My product isn't listed here". Now the Person object will look ...
Kartik's user avatar
  • 111
3 votes
1 answer
327 views

What domain objects might I need to represent a user and users profile in a forum web application

I’ve been trying to get a firm understanding of the MVC design pattern so that I can write my own framework for implementing the back-end of a forum web application using Slim 3. In particular, after ...
SneakyShrike's user avatar
0 votes
2 answers
1k 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) ...
JohnDoe's user avatar
  • 17
8 votes
2 answers
8k views

Separating Domain Object and Data Models

I looked through a lot of articles, blogs, and SO topics about separating domain object and data models. Almost every answer said: You should have separate classes for the domain and data persistence, ...
bielu000's user avatar
  • 267
1 vote
1 answer
245 views

Domain model and feature Crypter

In my project I must implement a feature for encrypting some information when it is written into the database, and decrypt the information when it is reloaded. Should this concept be implemented in ...
BruceStackOverFlow's user avatar
4 votes
1 answer
2k views

Domain Model vs Service in a MVC context

At the end of this article from Martin Fowler there is this sentence: In general, the more behavior you find in the services, the more likely you are to be robbing yourself of the benefits of a ...
floriank's user avatar
  • 471
5 votes
1 answer
905 views

Where does business logic go that involves multiple aggregates?

I'm still a beginner when it comes to domain driven design, and I am trying to model something like an RPG's battle system as a bounded context. I am trying to model a bounded context in which a ...
LayfieldK's user avatar
  • 161
3 votes
2 answers
193 views

Where to put domain classes in a component structure and diagram?

I've got a microservice called ExamResults, with a very simple component structure: ExamResults (offers: IExamResults) (requires: IExamResultsDAO) ExamResultsDAO (offers: IExamResultsDAO) This ...
KeizerHarm's user avatar
4 votes
2 answers
1k views

DDD: must all Aggregates model relationships, or they can be "shallow"?

Sometimes my Aggregate will be very simple; some scenarios are simply not complex enough to require deep trees of objects and relations. Consider a Website Monitoring application, which periodically ...
Levidad's user avatar
  • 798
4 votes
1 answer
956 views

In MVP, should the View have access to Domain objects?

Let's say I have a form for representing a user. When pressing the "Save" button, should a User object be: constructed by the View based on the input, then passed to the Model via the Presenter and ...
Michael Haddad's user avatar
16 votes
7 answers
3k views

Primitive vs Class to represent simple domain object?

What are general guidelines or rules of thumb for when to use a domain-speciifc object vs a plain String or number? Examples: Age class vs Integer? FirstName class vs String? UniqueID vs String ...
noctonura's user avatar
  • 281
118 votes
6 answers
31k 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
-1 votes
4 answers
110 views

Is there a term for an entity that represents another known missing entity?

I am working on a project where I am importing data from 3rd party sources. Often certain data is missing (usually older data), which is detectable from the data that I do have. Obviously I cannot ...
Ben Harrison's user avatar
  • 1,193
4 votes
1 answer
303 views

Making a change-prone class immutable

According to Effective Java's Item 15: Minimize Mutability, it is always better to make classes Immutable. According to that, how would I handle classes that are by nature given to change? Some ...
IntelliData's user avatar
2 votes
1 answer
1k views

How do you define Domain Objects and Repositories, when dealing with multiple database tables?

Imagine an application that allows you to add line items to a quote. The end result is like a sales person giving you a printed sheet with information such as name of the business, name of the sales ...
Dennis's user avatar
  • 8,157
2 votes
2 answers
1k views

Domain Driven Design - Aggregate Roots When All Data is Needed from Child Node

I'm struggling with a DDD concept in designing aggregate roots. I have a Client, which has multiple Projects, Projects have multiple Project assignments, which has multiple Employees. It seems natural ...
jkratz55's user avatar
  • 271
4 votes
2 answers
2k views

is it bad practice that controller call domain objects(entities) direclty instead of service?

is it bad practice that controller call the methods of domain objects directly instead of service? to explain more: I figure out that in good design controllers call service and service use Domain ...
Susantha7's user avatar
  • 396
2 votes
1 answer
2k views

Is a class representing a JSON response a DTO, a domain object, or something else?

Consider a restful service in Spring MVC. I am wondering how to package my response classes, i.e. how to name the containing package. First I thought of them as being domain objects. But they are ...
dsplynm's user avatar
  • 143
1 vote
2 answers
253 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 ...
Dennis's user avatar
  • 8,157
10 votes
2 answers
2k views

JavaFX - the right way to use Properties with domain objects

JavaFX has provided a bunch of new Property objects, such as javafx.beans.property.DoubleProperty which allow you to define fields which can be automatically observed and synchronised. In many JFX ...
pjm56's user avatar
  • 101