zartc (13) [Avatar] Offline

In section 2.1.1 Layered Architecture", you end up the discussion about the Business Layer in saying:
<<In some systems, this layer has its own internal representation of the business domain entities. Alternatively, it relies on a Domain Model implementation, shared with the other layers of the application. We'll have much more to say about this aspect later in this chapter. >>

I have read the whole chapter but couldn't find the promised dissertation about sharing Domain Model Object across application layer.

I am inclined to let the Entities objects bubble up the layers up to the Presentation layer. But I have seen many projects where Entities get replicated from layer to layer either by hand or by using Dozer, pretending that it shield the copy in the current layer from implementation changes in the source object pertaining to the below layer.

Entity Replication vs. Bubble-up is a topic that I would very much like see analyzed by you as specialists. Could you include a few sections on this topic, which state precisely what we can do with Entity objects?

Thanks in advance.
Christian Bauer (56) [Avatar] Offline
Re: About Entity object sharing across application layers
I've removed the "have much more to say about this aspect" statement, it was confusing. What we cover in this particular chapter is indeed only certain aspects of the domain model implementation, not how it is shared between application layers.

Data Transfer Objects/Classes and arguments for/against this pattern will be covered in the "Building enterprise applications" chapter.