thiebal wrote:
But even in my business layer, it's simplier to work with empty component than check each time I access them if they're not null.
IMO, it shouldn't. For example, Address is often mapped as a component. I find it a lot more easy to understand that, say, customer.getAddress() returns null because this customer has no address submitted yet instead of an anemic instance of Address.
Still imo, moreover, the thing is I think that the code that uses your API shouldn't have to know if some property is referencing a component or a real entity.
With this special component handling, customer.getAddress() would for example never be null, but customer.getBoughtItems() could be although this customer has neither Address nor bought items... I find it not satisfying 'cause there's no consistency between both usages.
Matter of taster, I suppose :-).