Suppose I have a home loan service, like Airbnb. I have a
House entity, which can have a name. There is also the
Booking entity, which has a start date, an end date and a name (which is not necessary but it is to ask the question).
The management rule would then be that no reserve can overlap. So, my global root would be the
Booking belong to this aggregate. This allows me to browse the bookings when there is a new one and check that there is no overlap. Here, the concept of aggregates and bounded context seems to me perfectly logical.
However, if I have to update the
Booking& # 39; The name of? If I need to update the
House name I can do it through the aggregate, which always bothers me because I have to load all the bookings just to change my name. But for the
BookingIn this case, I can not find a way to do it "DDD-y". If I go directly to the booking entity, I break the delimited context. Similarly, if I consult the set, I will charge the house and all other bookings only to change the name of a booking.
How is this case handled with DDD? Should I have a
Booking entity with only the parameters needed to check availability, and another, let's say
ReservationName through which I change my name? If so, do I need a new persistence object (that is, a repository or a mapper)?
It's a problem that has been bothering me for a few years and every time I meet it, I solve it less than ideally (like going to