Questions tagged [value-objects]

A value object is a fundamental concept of domain modeling in Domain-Driven Design.

A value object is a fundamental concept of domain modeling in Domain-Driven Design.

As defined by Eric Evans in his book, Domain-Driven Design: Tackling Complexity in the Heart of Software:

An object that represents a descriptive aspect of the domain with no conceptual identity is called a VALUE OBJECT. VALUE OBJECTS are instantiated to represent elements of the design that we care about only for what they are, not who or which they are.

324 questions
0
votes
1 answer

Multiple addresses as Entity or ValueObject?

I have a registration form for users that can insert multiple addresses. I take User as an entity but I am not sure about collections of addresses. if it was only one address I would take it as ValueObject but I am not sure what about collections of…
Mostafa
  • 43
  • 7
0
votes
1 answer

API Platform custom IRI with value objects

I am currently trying to create a custom IRI for one of my entities in API Platform. I know there is page in the documentation describing how to use a custom IRI (https://api-platform.com/docs/core/identifiers/), but I can't get it working. My…
SpigAndromeda
  • 174
  • 1
  • 11
0
votes
3 answers

How would I make separate duplicated logic in Value Objects

I'm learning DDD (Domain Driven Design) and reading Clean Architecture. I found out about Value Objects and have been reading more about them and have implemented some in my application which could be found…
0
votes
1 answer

Confusion regarding naming and structuring Value Objects in Domain Driven Design

I'm trying to implement my first domain driven application, after going through Eric Evan's book on Domain-Driven Design. I'm a bit confused on how to go about creating Value Objects. So in my application, a user can purchase a service for getting…
0
votes
1 answer

Aggregate invariants

I have doubts about where I should check my invariants... For example, I have a Question aggregate with the following invariant: The question's text must be not null The question's text must have a length between 100 and 500 characters I have read…
0
votes
1 answer

Laravel: ID as ValueObject is null after save

I'm using ValueObject casting as an ID of my model. Everything works fine when I get a record from database, however when it coming to saving, the ID is null. If I comment "casts" out, ID is correct. Example: $game = new…
VG-Electronics
  • 230
  • 2
  • 16
0
votes
2 answers

Domain Driven Design: dart package freezed gives "Failed Assertion boolean expression must not be null"

I am trying to build email model with authentication using this tutorial https://www.youtube.com/watch?v=fdUwW0GgcS8&list=PLB6lc7nQ1n4iS5p-IezFFgqP6YvAJy84U&index=2 The code is: import 'package:flutter/cupertino.dart'; import…
learyjk
  • 599
  • 1
  • 5
  • 14
0
votes
1 answer

loading data into form when vo object has object inside of it

I'm building a form to access/create/update based on a vo/dao pattern model that's already been made. I've been having good luck with name ?> since it's just blank if it's not loading an already existant object (using one form…
Damon
  • 10,493
  • 16
  • 86
  • 144
0
votes
1 answer

Difference between Entity and Value Objects in translation app

I am modelling domain for typical translation application to translate word between different world languages: That is my first DDD experience, however, I have quite OOP practice and therefore I've been surprised with confusing between Entity and…
Adam Shakhabov
  • 1,194
  • 2
  • 14
  • 35
0
votes
2 answers

PHP API REST: Catch all Value Objects Exceptions and render them as array

I am developing an PHP API REST using Value Objects. I have some value objects as like: ID, Date, Name, etc. When they fail in their construction due to a invalid format or something it throws a InvalidArgumentException. How can I "collect" all the…
0
votes
1 answer

Domain Driven Design - Inheritance in ValueObjects

User { name: String; paymentType: PaymentType; } PaymentType { //Common attributes } Can the above PaymentType(ValueObject) be inherited by these ValueObjects(Subclasses) - Credit, Cash, Cheque ? There is a…
Sneh
  • 413
  • 1
  • 5
  • 18
0
votes
4 answers

Actual difference between Value Objects and Entities. DDD

Domain-Driven Design, I'm trying to figure out what the difference some kind of mathematically and not intuitively. In my current project, we have some kind of payment transfers between banks. In this system, the bank is carried not like a physical…
Andriy
  • 362
  • 3
  • 16
0
votes
2 answers

Confusion with entities and aggregate roots for patients, dentists, treatments and medical history

I am new to DDD and decided to practice it with a dental clinic system I'm developing, but I'm struggling with modeling the domain so an extra pair of eyes will be greatly appreciated. For this dentistry system, the domain expert told me that a…
0
votes
1 answer

Where should I put value object creation logic if it involves accessing external API (Domain Driven Design)

I have an entity, let's say it is UserAccount. The UserAccount has an value object which is MembershipID. MembershipID becomes value object because it has some business logic inside it, not just merely a string. But there is a tricky situation…
Chrisma Daniel
  • 165
  • 2
  • 3
  • 8
0
votes
1 answer

How mapping ValueObject in EFCore3.1

The Entity: public class Good : FullAuditedAggregateRoot { ///******/// public virtual SaleStates SaleStates { get; set; } } The ModelBuilder: builder.Entity(b => { ///******/// …