If I understand your architecture correctly, you:
Client(works with disconnected Entities)
In essence, your SLSBs express their interface in terms of JPA objects, your DTOs are JPA objects. I see two possible scenarios:
- Your client only needs a subset of the data in your JPA objects, and you transfer more than you need. For example, you may need only the name of the employee, and you will send his entire life story.
- you cross more of the relationship tree than you intend
I feel that you must first determine exactly what you are getting in the client. It should be pretty easy to add some trace instructions to see exactly what data you have.
Perhaps by setting up lazy loading, etc. you can control the behavior.
My expectation is that you may need to define client-specific βsubsetsβ of DTOs, and your SLSB acts more like a facade, sending only the subset data. This works more, but you have great control over what is in the interface.
Architecturally, fine-tuning the remote interface is quite a reasonable thing to do.
source share