Questions tagged [domain-objects]
The domain-objects tag has no summary.
32 questions
0
votes
3
answers
496
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() {
...
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 ...
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 ...
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 ...
1
vote
3
answers
992
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
...
2
votes
1
answer
401
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 ...
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 ...
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) ...
1
vote
1
answer
316
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 ...
5
votes
1
answer
1k
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 ...
4
votes
2
answers
2k
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 ...
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
...
-1
votes
4
answers
121
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 ...
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 ...
4
votes
2
answers
3k
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 ...
1
vote
2
answers
283
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 ...