I have seen a couple of references to this, but no answer which I found helpful:
 
From an analysis/design point of view, just what should the granularity of EJBObjects be? Since EJBObject extends Remote any class implementing an interface which is an EJBObject cannot be passed by value. So this suggests that EJBObjects should not be fine-grained domain entities since in many situations this would result in frequent inefficient accesses to the server across a network
 
If they are large grained objects then they begin to fall more naturally into a class of higher-level 'manager'-like abstractions (viz, for example process-entity pattern) which manage many fine-grained objects in the domain. But you then lose the benefit of all of the lifecycle management and caching of those fine-grained entities which EJB servers are supposed to provide.
 
It seems a shame really, since if there were some way of passing EJBObjects by value they could still remain abstract definitions of domain entities, since the client-side need still only know about the interface to deserialize objects into its own VM. This would result in much greater choice and adaptation of the physical implementation to different problems/needs.
 
So, what is the 'ideal' use of EJBObjects?
 
Dickon
 
ECsoft UK Ltd
 

Reply via email to