I am new to DDD and NHibernate.
In my current project, I have a Person object that contains a value object, let it be an address. Today itβs wonderful. But maybe one day I will have a requirement that my value object (in this case Address) should become an entity.
Before trying to simulate this on a DDD path, in a more data-oriented approach, I had a Person table, with Id and another address of the table whose PK was actually FK, it was the identifier Man (i.e. the one-to-one relationship ").
I read that when I map the Value object as a component, its value will appear as columns in my Entity table (so I would not have a one-to-one relationship).
My idea was that if necessary, I would simply add a surrogate key to my address table, and then it would become an entity.
How do I create this using NHibernate? Should I already make the Address object an Entity object?
Sorry, I donβt even know if my questions are clear, I really got lost here.
source share