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
2 answers

Doctrine embeddable

I am trying to implement doctrine2 embeddable feature for value objects. This is simple snippet, slightly modified from doctrine official documentation: /** @Entity */ class User { /** @Embedded(class = "Address") */ protected $address; …
0
votes
1 answer

Problems compiling AutoValue library example project

I just discovered google's AutoValue library, which seems great. I'm trying to compile the example project which I downloaded from here But the project doesn't compile. The compiler complains about the AutoValue_ constructor symbol not being…
Nir Brachel
  • 413
  • 3
  • 12
0
votes
1 answer

EFCF 6 Complex Type mapping failing after refactoring toward Value Object pattern

I was refactoring a working implementation of a Complex Type class to apply the Value Object pattern which would make it an immutable type. I got that working, I had thought, until I tried to set up the migrations for these changes (the main change…
0
votes
1 answer

MyClass.inspect return incorrect class when I run whole test suite

MyClass.inspect return incorrect class when I run whole test suite. Problem: I have User::CreditCard and ActiveMerchant::Billing::CreditCard classes in project. Last from activemerchant gem. When I run single spec(rspec…
0
votes
1 answer

Spring data Mongo DB retrieving data : @Document VO returns null

I am trying to retrieve data from mongodb via spring framework. At first I made return type Map, but I decided to change to User value object. Below is the class for User VO @Document(collection = "user") public class User { …
Juneyoung Oh
  • 7,318
  • 16
  • 73
  • 121
0
votes
3 answers

DDD how to handle value objects without repository

I need some help with a value object. Consider the following example. I have entity Card which has pan currency(USD, EUR, GBP) and card type (Visa, Visa Electron, Mastercard). I think currencies and card types are value objects and they are stored…
Stasa
  • 115
  • 2
  • 13
0
votes
1 answer

Java Value Object Definition

I am investigating Java Value Objects for educational purposes. What I don't understand is why no one mentions (in same breath) having Java Value Objects implement Comparable? If Java Value Objects have to have "correct" HashCode & Equals for…
Hector
  • 4,016
  • 21
  • 112
  • 211
0
votes
1 answer

How to create Value-Objects in ASP.Net MVC, Entity Framework 6 project?

There are classes in my test applications: public class ApplicationDbContext : IdentityDbContext { public ApplicationDbContext() : base("DefaultConnection", throwIfV1Schema: false) { …
0
votes
2 answers

Practical use of Value Objects in Spring MVC application

In my application written in Hibernate and Spring MVC I've got simple classes representing Customer, his main office Address and list of Locations of rest of his offices. There is a form that allows to add and edit data of Customer, then Spring MVC…
mdziob
  • 1,116
  • 13
  • 26
0
votes
2 answers

ddd - Is my ValueObject implementation correct?

I am trying my best to create a web app to familiarize myself with DDD and ValueObjects. So far everything is working fine, I am just asking myself if I am correctly implementing my value objects. Here is my current state (code stripped from…
Lucio
  • 632
  • 5
  • 21
0
votes
2 answers

EntityFramework naming conventions for DDD ValueObjects

I use Domain Driven Design Pattern in my project. I have some ValueObjects like PersianDate that has a long type property. the name of ValueObject property in database be CreatedOn_PersianDate but I want its name be CreatedOn. I can change this…
0
votes
1 answer

Symfony embedded forms and constraints

Imagine a simple entity like this class User { /** * @ORM\Embedded(class="Role") */ protected $role; } and form type like this class UserType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array…
Mauro
  • 1,447
  • 1
  • 26
  • 46
0
votes
2 answers

JPA CriteriaQuery join three tables not directly navigable

i need to translate this sql query to jpa criteria: SELECT tbl1.id_t1, tbl2.name, tbl3.name, tbl4.symbol, tbl1.limit, tbl1.value, tbl1.uncertainty FROM table_1 AS tbl1 JOIN table_2 AS tbl2 ON tbl2.id_t2=tbl1.id_t2 JOIN table_3 AS tbl3 ON…
PatrickT80
  • 65
  • 2
  • 12
0
votes
1 answer

VO as a representation of view state

I'm sorry if my question is duplicated, I searched a lot and didn't find my answer. I'm using VO on a project Spring-MVC, then its very difficult to me to find what I need. It's okay to use a VO object that contains the representation of all fields…
danilo
  • 7,680
  • 7
  • 43
  • 46
0
votes
1 answer

Is there such a thing as "too many value objects" in a class? (I'm implementing DDD)

Note: I'm using PHP, but I think this question would be considered language agnostic. I'm also implementing "lite DDD", but I don't think that restricts the question any either. I have a class (entity) with a lot of properties that can be set (I…
prograhammer
  • 20,132
  • 13
  • 91
  • 118