value-objects

In DDD, what are the actual advantages of value objects?

南楼画角 提交于 2019-12-04 18:56:41
问题 I have gotten so far that I understand entity objects have an ID while value object have not, but in the most common example you have the person entity that have a address value object attached to it. What is the big advantage of creating a separate address object instead of just keeping the address properties within the Person Entity? 回答1: In addition to the things already mentioned, Greg Young makes a big deal out of the fact that since they are immutable, you can validate them on creation

Domain Objects and Value Objects - are they equal?

此生再无相见时 提交于 2019-12-04 04:42:26
By looking to the example of a Domain Object into Zend Quickstart tutorial, and other examples considering a DAO/VO patterns, they both seem to be very similar. Can we deduce that to say "Value Object" is the same as to say "Domain Object" ? If not, can you please clarify the differences between those? What is the function of one, and what if the function of another ? I'm asking this because, both are composed by getters and setters and nothing more then that. It seems that, they do the same function... Update: So, Zend Framework Quick Tutorial documentation called this, a domain object: //

DDD: what's the use of the difference between entities and value objects?

元气小坏坏 提交于 2019-12-03 14:24:57
Entities and value objects are both domain objects. What's the use of knowing the distinction between the two in DDD? Eg does thinking about domain objects as being either an entity or value object foster a cleaner domain model? Yes, it is very helpful to be able to tell the difference, particularly when you are designing and implementing your types. One of the main differences is when it comes to dealing with equality, since Entities should have quite different behavior than Value Objects. Knowing whether your object is an Entity or a Value Object tells you how you should implement equality

In DDD, what are the actual advantages of value objects?

自闭症网瘾萝莉.ら 提交于 2019-12-03 12:29:58
I have gotten so far that I understand entity objects have an ID while value object have not, but in the most common example you have the person entity that have a address value object attached to it. What is the big advantage of creating a separate address object instead of just keeping the address properties within the Person Entity? In addition to the things already mentioned, Greg Young makes a big deal out of the fact that since they are immutable, you can validate them on creation and never worry about validation again. If the state cannot be changed, then you know it's always valid.

Difference between Value Object pattern and Data Transfer pattern

荒凉一梦 提交于 2019-12-03 06:16:52
问题 In which scenario can I use those design patterns in n-tier architecture? 回答1: DTO is the object that you can use at the boundaries of the system. When you have a SOAP web service for example and you want to return response you would use DTO. It easier to deal with than actual XML that has to be returned over the wire. DTOs are often generated by tools, based on WSDL for example. DTO are often tailored to the needs of service consumer and can be affected by performance requirements. Value

Value Objects in CQRS - where to use

痴心易碎 提交于 2019-12-03 00:33:28
问题 Let's say we have CQRS-inspired architecture, with components such as Commands, Domain Model, Domain Events, Read Model DTOs. Of course, we can use Value Objects in our Domain Model. My question is, should they also be used in: Commands Events DTOs I haven't seen any examples where Value Objects (VO) are used in the components mentioned above. Instead, primitive types are used. Maybe it's just the simplistic examples. After all, my understanding of VOs use in DDD is that they act as a glue

Difference between Value Object pattern and Data Transfer pattern

跟風遠走 提交于 2019-12-02 19:42:46
In which scenario can I use those design patterns in n-tier architecture? DTO is the object that you can use at the boundaries of the system. When you have a SOAP web service for example and you want to return response you would use DTO. It easier to deal with than actual XML that has to be returned over the wire. DTOs are often generated by tools, based on WSDL for example. DTO are often tailored to the needs of service consumer and can be affected by performance requirements. Value objects on the other hand live in the core of the system. It captures pieces of business logic and maybe

Value Objects in CQRS - where to use

风流意气都作罢 提交于 2019-12-02 14:08:26
Let's say we have CQRS-inspired architecture, with components such as Commands, Domain Model, Domain Events, Read Model DTOs. Of course, we can use Value Objects in our Domain Model. My question is, should they also be used in: Commands Events DTOs I haven't seen any examples where Value Objects (VO) are used in the components mentioned above. Instead, primitive types are used. Maybe it's just the simplistic examples. After all, my understanding of VOs use in DDD is that they act as a glue for the whole application. My motivation: Commands. Let's say user submits a form which contains address

Separate table for Value Objects on NHibernate

偶尔善良 提交于 2019-11-30 15:59:31
问题 I'm new to DDD and NHibernate. In my current project, I have an entity Person, that contains a value object, let's say Address. Today, this is fine. But maybe one day I will have a requirement that my value object (in this case Address), will have to become an entity. Before trying to model this on a DDD-way, in a more data-centric approach, I had a table Person, with an Id, and another table Address, whose PK was actually an FK, it was the Id of a Person (ie, a one-to-one relationship). I've

Separate table for Value Objects on NHibernate

与世无争的帅哥 提交于 2019-11-30 15:36:28
I'm new to DDD and NHibernate. In my current project, I have an entity Person, that contains a value object, let's say Address. Today, this is fine. But maybe one day I will have a requirement that my value object (in this case Address), will have to become an entity. Before trying to model this on a DDD-way, in a more data-centric approach, I had a table Person, with an Id, and another table Address, whose PK was actually an FK, it was the Id of a Person (ie, a one-to-one relationship). I've been reading that when I map a Value Object as a Component, its value will get mapped as columns on my