> I guess the associations are only allowed between objects wirhin same
> aggregate, because you dont want the tight coupling between
> aggregates? When crossing aggregates, id references should be used?
>
> Im I right?
In DDD the conceptual integrity of an association between two Classes of Objects are only maintained within an Aggregate. Between Aggregates is not maintained.
For instance. If Purchase Order and PO Lines are part of the same Aggregate, the conceptual integrity of an association between them maintained.
Now say an Purchase Order and a Shipping Order part of distinct Aggregates. The conceptual integrity of an association between both is not maintained by the means provided by the Aggregate pattern.
Say that for instance a Purchased Order cannot be cancelled once a Shipping Order is fulfilled.
Using DDD patterns this cannot be absolutely guaranteed without breaking the conceptual boundaries of an Aggregate. So what you do is a best effort to enforce such constraint in the PO, yet we need to think about cases where it was not possible.
You may ask why is not possible? I would discuss the answer to that question with the domain expert.
Cheers,
Nuno