Questions tagged [domain-objects]
The domain-objects tag has no usage guidance.
31
questions
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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{
...
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 ...
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 ...
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 ...
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 ...
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) ...
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, ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
...
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?
-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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...