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

DDD value object composite identifier

I was trying to understand DDD value objects and entities, and have a minor doubt in that. I've read in a lot of articles that value objects does not have identity. I wanted clarity on whether that the identity referred here is a single attribute or…
0
votes
1 answer

What is the best way to avoid referencing an entity inside an aggregate?

I am new to DDD. I just started a project by DDD architecture. In domain design I faced a problem. Given I have a customer that supposed to send me a list of his/her orders, for example: customer1:{Onion,Apple,orange,wireless…
0
votes
1 answer

Defining DDD entities and object values from a dataset of measurements

I am working on an ML project with a dataset of operating points for a diesel engine. The dataset contains roughly 100 features, ranging from various temperature measurements of fuel/air/exhaust to engine speed and more. I am looking to apply a DDD…
0
votes
1 answer

Persistence of the 1:m relation which don't have individual entity but dependent on root aggregate/entity + DDD

Let's say we have a cafe enity/AR and it has regular opening hours and some explicit opening and closing hours as attriubutes (VO). Each cafe can have multiple sets of opening and closing hours including regular hours. let Cafe = { guid:…
Mr X
  • 1,637
  • 3
  • 29
  • 55
0
votes
1 answer

Configure value object with inheritance relationship in EF Core 6 Fluent API

I am trying to implement DDD in one of my project where I am struggling to configure value object in ef-core 6 fluent api. My value Object is a abstract type Schedule and it has concrete type such as Daily, Monthly etc. public abstract class…
0
votes
2 answers

How to implement for a Web API project field level permission with EF Core 6 and value objects

I'm quite frustrated trying to figure out a possible implementation. Pursuant DDD and CQS concepts the write side of my application uses various aggregates and associated repositories that are implemented with EF Core. On the read side I want to use…
M. Koch
  • 525
  • 4
  • 20
0
votes
1 answer

Should invariants be unit tested both in the application service and the aggregate root?

I got multiple value objects (VOs) inside my aggregate root (AR). Each VO does invariant checks when created, such as string min/max length, regexp, etc. Each VO is created when the AR is created and the AR is unit tested with 100% coverage. Since…
Andrea Damiani
  • 611
  • 1
  • 6
  • 20
0
votes
1 answer

FluentNhibernate Map ValueObject

I have the following use case: public class Object { long Id ... ISet tags } public class Tag : IEquatable { string Label; } Object is an Aggregate Root and Tag a Value Object. Both are stored in 2 different…
Ben D
  • 465
  • 1
  • 6
  • 20
0
votes
1 answer

Paramterized classes in Typescript?

I'm trying to reduce some boilerplate in a Typescript project using DDD. My goal is to have a quick way to make a strongly typed Value Object where the only value is a string with a bounded length. My first attempt was this: type BoundedStringProps…
Calin Leafshade
  • 1,195
  • 1
  • 12
  • 22
0
votes
0 answers

EF Core 5 Owned type does not return saved data from database

I'm implementing a small project aplying DDD on it, but I'm having problems with Value Objects. I have the following Term entity: public class Term : Entity, IAggregateRoot { #region Properties public string Code { get; set; } …
0
votes
2 answers

DDD, problem with value objects and "new Domain()"

I have a question, I am migrating from MVC to hexagonal architecture and DDD architecture in a laravel project. I understand that a value object represents an attribute of table X but I have a problem, I have a table with 60 columns, would it have…
0
votes
1 answer

Selection in Flex Datagrid does not pass the valueObject to selectionChangeHandler function

I have a TabNavigator, and each tab is a Module. One of the modules is labelled Units and the full code of the module is posted in this post. There are several problems: 1) Forms are not populated with data from the datagrid selection. 2) Selecting…
Shailen
  • 7,909
  • 3
  • 29
  • 37
0
votes
0 answers

Re-Parenting of Owned Children

I have a problem with re-parenting owned children. My model is as follows: Shift owns an Itinerary Itinerary owns many Waypoints Waypoint owns many Assignments public class Shift { public Guid Id { get; } public Itinerary Itinerary…
0
votes
1 answer

DDD: Always create ValueObject even with all fields null

Scenario The City and Street fields are NOT required on my domain. I have a ValueObject public class Address : ValueObject { public string City { get; private set; } public string Street { get; private set; } public Address(string…
Max
  • 6,821
  • 3
  • 43
  • 59
0
votes
2 answers

DDD - Life cycle of Value Objects: Validation & Persistence

I understand what is VO (immutable, no-identity, ...). But I have several questions that are from discussion with my co-workers. A) Validation - How precise should it be? What types of validation should I put into VO? Only basic ones or all? Good…