Hello, Let me describe the situation. I have a Person class that has a Set of Addresses. Now in the DB, there are three tables: person, person_address, and...
In practice, addresses usually are entities, not value objects. Just from your data model, if you have a person_address table to associate person with address,...
Berty, <your quote> When, however, address is meaningless unless tied to a person, you should dump the person_address table and introduce a foreign key in your...
Karthik, ... Person object ... model (and ... I'd say that's okay, but it all depends on the granularity of the update operations (e.g. an updateAddress(a),...
Your adddress is still an entity - no longer a top-level one. It's editable so it's an entity. Make sure you carry its ID along when you retrieve it. Hibernate...
berty, isn't it strange though? if i chose to keep address attributes in the person table, versus moved them to a table of their own (for DB reasons), i end...
... person table, versus moved them to a table of their own (for DB reasons), i end up with a >situation of vo versus entity. ... email, which might be stored...
Conceptually, all is well. But reality may be a little tougher to persuade. The problem as it was outlined earlier is that there must a way to distinguish the...
I'm starting out with something new, and just after a couple of lines of code i stumble upon the Date problem. Javas libs are quite famous for beeing too...
... How about feedback from another wandering soul? :) I agree with Sergio. Reading is often quite different from creating and adding and getting the lineItems...
The issue of entity vs value object isn't simply one of persistence. It's an issue of variability which occurs in both objects and databases independently. ...
... This group IsA Forum with the option to receive mail when posts occur.. I have so many feeds I follow, I chose to receive the e-mails because I wouldn't...
Just some more thoughts on this common relationship between Person and Address... I think the database makes the distinction between Value Object and Entity...
Chiming in on an earlier point... if you add an address_id as a FK to the Person table, you can keep the address table to store information for any other...
... Yeah, I agree! "joda-time" library works very well. We've used it in a couple of projects too. -- Yagiz Erkan -- http://blog.decaresystems.ie...
Yagiz Erkan
yagizerkan@...
Mar 1, 2006 9:09 pm
3475
Why is it necessary for the java code to create a new address object simply because one of its attributes changes? Particularly, why is that the expected...
BTW, I just responded via e-mail to the Value vs Entity discussion because I received the thread in my e-mail. How is it that a 'forum' is different than this?...
Jonathan, this goes back to Eric's DDD book and the distinction between entities and value objects. if you read up that section you'd be able to relate. So...
Christian, Very nice summary of the approach. I agree with you. One last thing though. If a new() corresponds to a new row in the address table, how do we...
Keith, In such a case, I would prefer to keep join tables. So let's say Person and Location both have an Address. I would prefer this schema person location ...
Pascal, ... Hmmm. I still have a discomfort with this, it puts the domain in an "unnatural state". Because the domain gets updated in the view layer and not...
My guess would be that some people prefer the forum interface. As I said before; there are systems out the such as community server which can support both...
Hi Jonathan, ... object simply ... the ... understanding. The key reason that the address shouldn't change is based on the usual argument that "Value Objects...
Hey Karthik, Thanks for the recap.. I loved Eric's book by the way, and highly recommend it -- of course, it's practically required reading at ThoughtWorks. I...
Still, I can see the threaded discussions online and/or the threaded discussions in my e-mail InBox, and I can respond in either situation. I guess I've never...
Hey Christian, Thanks for the considered response. It seems to me that there is a domain-based issue with immutability, such that the rules/conventions of the...
... this particular object, it invalidates the original; necessitating a wholly new instance of >the object", I say, "Interesting! Potentially inefficient, ...
alasdair, exactly my point with addresses. however how does one make sure that the old address is removed from the database? so if i have a person table and a...