Skip to main content

Questions tagged [domain-objects]

0 votes
3 answers
475 views

Do I really need this many (DTO) types for mapping a simple object to CRUD & database?

Say I'm building my own backend framework (really I'm just learning) and I have a simple class: class User { String email String passwordHash Date birthdate Int getAge() { ...
Mahi's user avatar
  • 406
0 votes
2 answers
290 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
1 answer
1k 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
4 votes
3 answers
1k 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,064
2 votes
1 answer
3k 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
1 vote
0 answers
146 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
977 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
1k 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
986 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
2k 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
394 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
  • 77
1 vote
0 answers
316 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
104 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
417 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
2k 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

15 30 50 per page