Questions tagged [entity]
The entity tag has no usage guidance.
110
questions
-2
votes
2answers
72 views
How to change a data model
In my model a user entity has three attributes : ID, name, hasBoyfriend.
I want now to change hasBoyfriend to boyFriendsNames which is an array of names .
The user entity is used by many services.
The ...
2
votes
2answers
65 views
Relationship between entities in different aggregates and size of aggregate
I read a lot about DDD but few thing are still unclear. At this moment I have two dilemma
The size of aggregates. How small could be an aggregate?
For example we have:
class Car {
String colorId
...
1
vote
2answers
102 views
Database Design: Storing price date wise, or date range wise?
I must store prices for various items on multiple dates. The table schema would look like this:
CREATE TABLE date_wise_price (
item_code varchar,
date date,
price numeric(19,4)
)
An ...
-3
votes
1answer
41 views
What is proper approach to code first entity relationship design?
I been trying to figure out, what i hoped is a simple problem, but am yet to land with an answer.
How do you go about designing an entity relationship diagram when doing code first development?
The ...
2
votes
2answers
144 views
Entity delete validation in a microservice environment
In a microservice environment there are two services: Service A and Service B.
Service A manages an entity called x which has one to many relationship with service B's entity called y
When a network ...
1
vote
1answer
72 views
How to decide on abstraction level and entity definitions?
I am working on a hobby project of mine where I want to make an application to doing my personal finances. Just for learning. I am trying to adhere and implement best practices and patterns to learn ...
0
votes
1answer
77 views
Can I put domain services inside domain entities?
Say I have a domain entity User:
class User {
constructor (username, email, password) {
this.username = username
this.email = email
this.password = password
}
}
Now, all users need a ...
0
votes
0answers
23 views
Kafka with log compaction best approach
I am publishing entities with entity-id (message-key) + version in kafka. I decided to use log compaction to ensure that atleast 1 version of the entity is available at all times and for that to be ...
0
votes
1answer
2k views
Best practice for references in DTOs and entities in Spring
Given the following architecture and frameworks:
Spring Boot Application with Spring Data JPA (Hibernate is used as OR mapper); layered architecture as followed.
REST layer
Service layer
Persistence ...
7
votes
2answers
304 views
Why can't Entities leave the inner layers in the Clean Architecture?
I was reading about the clean architecture, and I don't get this part:
Don't use your Entity objects as data structures to pass around in the outer layers. Make separate data model objects for that.
...
0
votes
1answer
105 views
Need for a domain model in a service in 3 tier architecture?
I am building an API Rest with Spring Boot and I would like to clarify a concept about my architecture, to see if the community can help me.
Imagine that in my database I have a table called Person. ...
0
votes
0answers
104 views
DDD Value Objects and Entity Without ORM Mapping in PHP
First, as I know, Entity in DDD is almost same with Value Object except Entity has identity. Every article I have read say same thing that entity id has ORM mapping with any ORM tool. But I donāt want ...
1
vote
0answers
70 views
Changing entities in Clean Architecture
I'm modeling the "Domain" Layer of "Clean Architecture" for an application that gets its data from an XML file when starts.
The XML file looks like:
<?xml version="1.0" encoding="UTF-8" ?>
<...
1
vote
2answers
442 views
When to model an aggregate's entities as part of a value object?
I've read a lot about Domain Driven Design including books from Eric Evans and Vaughn Vernon. So I am familiar with the concepts Aggregate Root, Entity, and Value Object.
But while I was modeling ...
7
votes
3answers
2k views
Domain vs Entities model? Domain-Driven-Design (DDD)?
In this github, https://github.com/johnph/simple-transaction, under the Transaction.Framework project, there are entities (located at Data/Entities)
AccountSummaryEntity.cs
AccountTransactionEntity
...
3
votes
4answers
375 views
What is optimal number of entity abstraction levels?
Sorry about the vague question, please do suggest different formulations. Anyway here is the kernel of the question:
How many classes representing an entity/resource or whatever you want to call it, ...
7
votes
1answer
393 views
How to prevent concurrency problems when using the repository pattern?
Considering that:
when using the repository pattern you deal with entities - those are the atomic units you persist (regardless of Hibernate or "manually")
when changing an entity you save it as a ...
1
vote
1answer
869 views
Aggregate root being created by multiple other aggregate roots
I know the title is confusing, I didn't how to word it.
I'm studying the Domain Driven Design (DDD) and I'm reading the book "NET Microservices Architecture for Containerized NET Applications" from ...
2
votes
1answer
139 views
Can we have a ternary relationship together with a recursive one in E-R diagrams
I am designing an E-R Diagram for a simple system where there are some users and contests. A user can create a contest or invite other users to the contest who can decide to accept or not.
I am ...
0
votes
1answer
444 views
How to determine aggregates when entities are shared?
So I'm trying to figure out exactly what my aggregates/aggregate roots are in my structure, and can't seem to wrap my head around it.
Database contains the following tables:
SALESGROUP
ID
...
1
vote
2answers
1k views
Depend on DDD Entities or Interfaces?
My understanding is that the dependency inversion principle does not apply to entities, because entities basically are your application - it generally doesn't make sense to swap out a different ...
-3
votes
2answers
658 views
What is DDD's concepts mapping to microservice's concepts? [closed]
DDD concepts: Domain, Aggregate, Entity, Value object, Bounded context
Should every aggregate be a single microservice and have a single DB
( since every microservice should have a single specific DB)...
0
votes
1answer
64 views
Do menu option lists (and similar labels) belong in the database?
I am moving in the direction from database-centric design to entity-centric design (say, starting with class definitions instead of starting with a ERD), and am questioning things:
Often in a ...
4
votes
2answers
415 views
Repository pattern usage
I need some advice regarding repository pattern. Let's assume i have UserBal which stands for business logic which uses UserRepositoryDal where all database logic for that entity stands (queries to ...
0
votes
1answer
141 views
Using the same entity for different use cases
Suppose I have a User entity with name and age attributes. A User can own Boxes. A Box has the name and color attributes. Business rules dictate that one User can own at most 5 boxes. So, in this case,...
1
vote
2answers
433 views
Domain models vs entity models vs Hibernate lazy loading
In a new Java project I plan to use an extra layer above Hibernate entities. So there would be a CustomerEntity and CustomerDomain. The reason for that is that the CustomerDomain can contain extra ...
0
votes
1answer
175 views
Modify a property of an aggregate's entity
Suppose I have a house-lending service, like Airbnb. I have a House entity, which can have a name. There's also the Reservation entity, which has a start date, an end date, and a name (which isn't ...
4
votes
3answers
167 views
ER diagram - feasibility of a requirement
I need to model the following requirement in an Entity-Relationship diagram.
"Customers place orders, which contain a list of products with their quantity and prices. A shipment is made when ...
5
votes
3answers
232 views
Is a repository return a graph of entities violating SRP?
I'm working in this scenario
Post entity has many Image entities.
I also have repository to both entities:
PostRepository
ImageRepository
Since this entities are tightly related, when I get a Post ...
0
votes
1answer
66 views
Delete dependent entities
I have a temporary report table which has a foreign key (source_id), e.g. report table:
| id | val1 | val2 | source_id |
| -- | ---- | ---- | --------- |
| 1 | 102 | 0.5 | 1 |
| 2 | 99 |...
1
vote
1answer
115 views
How to set nullable/optional property of database object to NULL in backend?
We are building API which mainly passes database objects back and forth between user and database, so the main flow of information is quite basic:
Table (view) <-- ORM --> C#/Java/etc. Objects &...
1
vote
2answers
481 views
When converting the ER into the class diagram, what happened to the Weak Entities in the ER diagram
I am trying to convert an ER diagram into a class diagram. Below image is showing that part of my ER diagram and which contains a weak entity call 'Parent'. Therefore when we consider the ER diagram, ...
3
votes
3answers
4k views
Business Logic Entities and Data Access Layer Entities
I am thinking on how to structure a project. I wonder if it is a good practice to use different entity classes between the BL and DAL in order to decouple these layers.
I have worked on projects ...
-1
votes
1answer
621 views
Updating entity with REST
I'm looking for the "Holy Grail" (best practise) of how to update an entity with REST?
There are three main approaches I've found so far:
Always send full entity, regardless what has been changed ...
0
votes
2answers
358 views
Should entity properties be represented by a value object?
I read somewhere that one should be generous in creating value objects for entity properties that are part of the class API.
So I did that with my project entity/aggregate, but it still looks weird:
...
1
vote
1answer
617 views
PHP: Domain model and aggregates
I am building an app that uses a client and a project entity.
The clients can extend their profile over various screens in their account, like status, settings, etc. These data sets are saved in ...
0
votes
1answer
93 views
Best way to handle environment specif fields in Hibernate
We have one microservice that will be deployed on two different environments(A and B). There are some common fields and also some are specific to the environment.
Example:
SomeEntity for environment ...
1
vote
2answers
1k views
Should i use an abstract class or an interface for my doctrine model?
In Doctrine, assuming I want to implement different types of vehicles. Maybe a car, a plane, a bicycle and so on ... all these vehicles have many different properties but also very common things like ...
3
votes
2answers
972 views
DDD - delegate business rule of domain object to external service
Situation:
I am implementing DDD in my first project and I would like to clarify how to correctly implement strategy pattern (in my case check if API token is active). This is a business rule of ...
32
votes
1answer
39k views
What is the use of DTO instead of Entity?
I am working on RCP application, I'm new to this application.
Spring beans are used to write business logic to save/fetch entities.
But, instead of sending entities directly to client we are ...
4
votes
1answer
475 views
DDD: How to work with entity variations?
Let's say I have an Entity that represents an employee:
Employee
First name
Last name
Birthdate
Hair color
Eye color
Gender
.... (and so on)
Now, imagine I have a website ...
8
votes
1answer
10k views
Data Objects for each layer(DTO vs Entity vs Response objects)
Let's say I'm building a Customer web application(in Spring Boot 2), which also exposes rest end points. I'm modeling my application into 3 layers.
a) UI - CustomerDTO
b) REST - ...
1
vote
1answer
492 views
Imposing conditional entity relations
While working on an application, I am facing an issue. And I am not sure how to solve this.
For explanation I have managed to come up with a simple example below:
Consider a Grocery Store ...
4
votes
5answers
2k views
Why is the ampersand (&) a HTML Entity?
I understand the rationale behind why most of the HTML character Entities were created, but I don't understand the purpose behind the ampersand HTML entity. & contains more bits than a & ...
1
vote
1answer
1k views
What is the best practice for API endpoints for an entity?
I don't know if the title is reflecting the question correctly, but I can explain more than write a good title.
If I have a database that has (employees, departments, orders, etc...), and have ...
5
votes
1answer
2k views
Is it normal for a Domain Model not to have an ID?
After reading the book; I understood the following:
1) Entities should implement equality and compare by ID.
2) Value Objects should implement equality and compare by all properties in the class.
I ...
2
votes
2answers
79 views
Sql: Pre inserting relational entities vs the “lazy creation” of the entities
I have the following entities in my database (it's simplified):
Student (id)
StudentCourse (id, student_id, course_id)
Course (id)
Lesson (id)
LessonCourse (id, lesson_id, course_id)
...
4
votes
1answer
9k views
Shall the Database in a sequence diagram be represented as actor or boundary?
I'm designing a system made of a web application and database. I use the <<Entity>> - <<Control>> - <<Boundary>> stereotypes in my UML diagram.
In the following ...
-2
votes
1answer
152 views
Filling in background information in terms of DDD
Recently, I asked about my difficulties in finding the boundaries of aggregates
here
and I recently reinterpreted it and rid it of business features and now it sounds like this:
In many sources, ...
10
votes
2answers
3k views
How to design the aggregate boundaries?
I would like to write an application something like ecommerce.
And you know that in similar applications products could have different properties and features. To simulate such an opportunity I've ...