Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [entity]

The tag has no usage guidance.

1
vote
1answer
79 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
50 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, ...
0
votes
0answers
20 views

Distribution of entity operation across DA and Service layer

I have a JPA entity A which has an attribute position that specifies the ordering, e.g. @Data @Entity public class A { @Id private Long id; @Column private Integer position; } Now I want to ...
2
votes
3answers
144 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
38 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
1answer
100 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
45 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
27 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 ...
0
votes
2answers
215 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 ...
2
votes
2answers
166 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 ...
2
votes
1answer
418 views

Use Spring JPA entities as domain model entities in DDD?

Is good idea to use Spring JPA entity classes from my data model as entities for domain model in domain driven design? Or should it be mapped into separated ddd entities. What is best practice / ...
4
votes
1answer
155 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 ...
1
vote
1answer
2k 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. 1) a) UI - CustomerDTO b) REST - ...
1
vote
1answer
50 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 ...
2
votes
4answers
568 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. &amp; contains more bits than a & ...
0
votes
1answer
541 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 ...
2
votes
1answer
474 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 ...
1
vote
2answers
70 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) ...
1
vote
1answer
2k 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
135 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
782 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 ...
4
votes
1answer
393 views

DDD - Domain Modelling association between aggregates

I have a bit of a mental block when trying to model my scenario whilst practicing DDD. The problem appears to be around 2 entities you would consider to be aggregate roots. I feel these aggregate ...
1
vote
1answer
812 views

Service layer with DTO

I'm refactoring my desing to use a service layer - however I'm confused about how you would pass arguments, when it's only allowed to update certain fields of the entity. For instance I have some ...
0
votes
4answers
229 views

The Open/Closed Principle, how does it work for adding entities?

I'm not even sure how to ask this, but here goes: Let's say I have a Web application that incorporates Teachers, Courses and Students in such a way that I can do things like this (pseudocode): ...
1
vote
4answers
2k views

ASP.NET Projects using too much .NET Boilerplate Libraries / Code

I am very puzzled with the obsession that many people seem to have with using Microsoft frameworks. I have seen several tutorials and projects (both open and closed source) that seem to utilize all of ...
0
votes
1answer
1k views

How to represent and validate website URLs for a JPA entity

I have an application that will allow the user to enter and store (in a DB) a website URL for a company. The only requirement (as of now) beyond entry of the website URL is to validate that the URL is ...
1
vote
2answers
309 views

How to really decide whether an entity is weak or not

This is the ER diagram example from the Wikipedia. Here they have marked the Orders entity as a strong entity. As I understand a weak entity is an entity which cannot exist without a corresponding ...
-1
votes
4answers
90 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 ...
1
vote
2answers
99 views

Dealing with entities customization

I suppose every project that is considered as huge and diversed into a lot of parts (admin side, widgets, API, website with a lot of stuff and management) can finally encounter that it is actually ...
0
votes
1answer
668 views

Should I extend an entity object with a separate class?

I have a simple entity class in my C# application that I would like to add additional properties to for use in the app. These properties will not be persisted to the database. In the past, I was ...
5
votes
2answers
614 views

A more data oriented design approach to Entity Component System

I'm creating my first c++ game engine project (for learning purposes) and in it I've attempted to implement an entity/component system utilizing some data oriented design principles while also not ...
11
votes
2answers
2k views

How to create new aggregate root in CQRS?

How should we create new aggregate roots in cqrs architecture? In this example I want to create new aggregate root AR2 that holds reference to first one AR1. I'm creating AR2 using AR1 method as ...
4
votes
2answers
426 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 ...
3
votes
1answer
304 views

Configuring entity behavior DDD

In one of the products I work with we have an aggregation root with a lot of domain logic, and now I have a requirement to make one small piece of behavior configurable. To give an example, let's say ...
5
votes
1answer
187 views

Should I retrieve related entities from the parent entity or the service layer?

Let's say I have a three tier application structure, with Presentation, Service and Data layers. The data layer is managed by an ORM and has two models/entities, Show and Episode, with a one-to-many ...
2
votes
2answers
563 views

How chose a design for an event system

I'm working on a Entity Component System for learning purpose. I made major changes with my design so I was wondering if I could pick a better design for my event system. The purpose of the event ...
0
votes
0answers
27 views

Sort an 2D entity-diagram

Entity-relationship-diagrams can really be a mess. I am looking for a good sortion algorithm. So what is good? My current algorithm calculates the badness-factor: No lines cross (badness-factor x2). ...
4
votes
1answer
2k views

Java DDD project organization

Just wanted to hear opinions on this kind of project structure in java for one DDD project: com.some.namespace application services = (app services that talk to repositories and domain model) ...
0
votes
1answer
800 views

MVVM Model vs. DDD Entity

I have just stepped into the Domain Driven Design paradigm but I have one question: How is an MVVM Model different from a DDD Entity? What are the differences between these two?
3
votes
2answers
215 views

How to correctly model aggregation with respect to persistence?

When modeling bigger domain entities you will probably have some kind of relation between these entities. These relations will usually result in entities referencing different entities. If i am not ...
1
vote
1answer
355 views

ERD for a Lab Database

Question: In a database for a clinical reference lab a specimen, when taken, triggers a test order (for testing obviously) creation.If that test order produces a failure, the specimen is given a new ...
2
votes
2answers
2k views

How to avoid circular reference in OOP Javascript?

I have a problem while working with entity framework in JavaScript. I have two classes Table and Column Class Table { Columns: Column[] } Class Column { Parent: Table } Everything works fine until ...
0
votes
0answers
41 views

Should I use weak entity instead of regular to describe my kind of components?

First time trying to make a E/R model of my database. Trying to understand weak entities and regular entities. Should I make the CPU, RAM, Mainboard, etc. entities weak instead of regular?
3
votes
1answer
233 views

Correctness of ERD diagrams

I am new to database modeling.Here is a problem I was trying to solve: Information about movies,stars and studios.Movies are shot in studios that own them.A movie is shot in only one studio.Stars are ...
3
votes
1answer
436 views

When mapping from a database, do OOP objects (entities) need to store the database values in attributes?

When it comes to OOP where an external database is being read from and written to, is it necessary to have attributes/properties within the objects to store the data? Or is it enough to simply read ...
1
vote
1answer
3k views

c# extending a entity framework class

I have a Entity Framework class that was derived from the database layout. I was wondering if there was any problems by extending the class by creating another cs file and using the same public ...
9
votes
2answers
393 views

Should well-known business ID of an entity be represented with a dedicated type in DDD/OOP?

In practical terms it means using an custom (immutable) class over a string or some other primitive type. Examples: Publishing: International Standard Book Number. Finance: International Securities ...
0
votes
1answer
376 views

VO to Entity Conversion

In our application we have multiple layers. UI -> This can be JSP/ JSON result of the API Controllers -> as in MVC Services -> perform single business operation per service DAOs -> Data Access ...
81
votes
13answers
11k views

Do objects in OOP have to represent an entity?

Does an object have to represent an entity? By an entity I mean something like a Product, Motor, a ParkingLot etc, a physical, or even a clear-cut non-physical conceptual object -- something that ...
0
votes
1answer
109 views

What should this interface contain?

I am creating a schema for Doctrine but first I'm creating interfaces, abstract classes (models) which will be extended by the entities. I have a PresentationInterface which contain getter and ...