value-objects

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

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? ...

Generating ActionScript value objects from an xsd schema

Are there any tools available for transforming types defined in an xsd schema (may or may not include other xsd files) into ActionScript value objects? I've been googling this for a while but can't seem to find any tools and I'm pondering wether writing such a tool would save us more time right now than to simply code our value objects b...

How are Value Objects stored in the database?

I haven't really seen any examples, but I assume that they are saved inside the containing entity table within the database. Ie. If I have a Person entity/aggregate root and a corresponding Person table, if it had a Value Object called Address, Address values would be saved inside this Person table! Does that make sense for a domain wh...

Null value objects in NHibernate

I have a person entity containing an Address as a value object: public Person() { WithTable("Person"); Id(x => x.Id); Component<Address>(x => x.Address, a => { a.Map(x => x.Address1); a.Map(x => x.Address2); a.Map(x => x.Address3); a.Map(x => x.Town); a.Map(x => x.Postcode); }); } It states...

Mutable Value Objects / Sharing State (and beer brewing!)

I'm a rusty programmer attempting to become learned in the field again. I've discovered, fitfully, that my self-taught and formal education both induced some bad habits. As such, I'm trying to get my mind around good design patterns, and -- by extension -- when they're wrong. The language is Java, and here's my issue: I'm attempting to ...

DDD, value objects and ORM

Value objects got no identity. ORM needs identity to update database. How to trick ORM? (marking Id for value object as internal won't work, cause ORM lives in different assembly and moving it to the same assembly is not acceptable). Thanks in advance. ...

Separate table for Value Objects on NHibernate

Hello, 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-cent...

Might EnumMap be considered a reasonable alternative to Java beans?

Curious if anybody has considered using EnumMap in place of Java beans, particularly "value objects" (with no behavior)? To me it seems that one advantage would be that the name of a "property" would be directly accessible from the backing Enum, with no need for reflection, and therefore I'd assume it would be faster. ...

Should I add VOs into a library project when developing using flex modules?

I'm developing a module based applications in Flex and I was thinking about moving all my Value Objects (VOs) into a library project and I was wondering if any thinks this is a bad idea or have any alternative suggestions. Current Structure: I have a project that consist of a shell application and 3 modules. The modules contain about 1...

Value object or entity object in my Hibernate mapping?

Hey everyone, I'm trying to design a pretty simple app and am getting myself a bit confused with Hibernate's definition of entity and value objects (as defined in Chapter 4 of Java Persistence with Hibernate). What I have is an app with customers, who can place orders (one to many relationship). Each of these orders has many order line...

java value object

I'm new to Java and I have to create a value object, (maybe it's called mapped object in Java) but my code doesn't seem to work, here is the value object: package ....; public class User { private int id; private int uid; private String name; public User() { // do something here } } and I assi...

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

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? ...

DDD: Can a Value Object have lists inside them?

I'm not well versed in domain driven design and I've recently started created a domain model for a project. I still haven't decided on an ORM (though I will likely go with NHibernate) and I am currently trying to ensure that my Value Objects should be just that. I have a few VOs that have almost no behavior other than to encapsulate "li...

how to model value object relationships?

context: I have an entity Book. A book can have one or more Descriptions. Descriptions are value objects. problem: A description can be more specific than another description. Eg if a description contains the content of the book and how the cover looks it is more specific than a description that only discusses how the cover looks. I don...

Method chaining with value objects

is it acceptable/good-practice to use the method chaining pattern on value objects (like, returning a new object instead of this)? are there cases out there where this solution is implemented ? I cannot think of any drawbacks, but I'd like to hear your point. ...

Help with understanding usage of Value Objects in Flex

Hello! I have some small problem in understanding Value Objects in Flex... I'm trying to get some data from PHP/MySQL and send it to Flex but I'm stuck in some (obviously) basic problems... Let's say That my object in Flex would look like this: package some.package.VO { [RemoteClass(alias="VOPerson")] [Bindable] public...

What's the different between Value Object and a generic Class in AS3?

I don't understand what is structurally different between a Value Object and a Class in ActionScript3. Can any Class be a VO if you decide to call it one? Thanks. ...

Value objects vs associative arrays in PHP

(This question uses PHP as context but isn't restricted to PHP only. e.g. Any language with built in hash is also relevant) Let's look at this example (PHP): function makeAFredUsingAssoc() { return array( 'id'=>1337, 'height'=>137, 'name'=>"Green Fred"); } Versus: class Fred { public $id; public $...

Entity, Value Object or what is it and where it should be?

I have class called 'Tool'. Tool has properties like: Name, Description and some specific others. Tool is special because Name and others are read only but description can be modified by users. Count of tools is constant and known at development time. It is not Value Object because I need to query them and show to users where they can u...

How value objects are saving and loading?

Since there isn't respositories for value objects. How can I load all value objects? Suppose we are modeling a blog application and we have this classes: Post (Entity) Comment (Value object) Tag (Value object) PostsRespository (Respository) I Know that when I save a new post, its tags are saving with it in the same table. But how c...