Should one still use Composite Enitity Pattern (j2ee pattern) when designing application in EJB2? or is the pattern no long valid since EJB2 now support Local client view (EJBLocalHome, EJBLocalObject) and one could just implement bunch of fine-grained local entity beans with Session Facade pattern.
The fact that EJB 2.0 supports local interfaces does not mean that all calls to beans would be through local interfaces only. There would be situations where you might have to deal with remote interfaces (especially when your EJB container is clustered and the client/bean are not in the same VM).
With the advent of local interfaces, Session Facade still retains its value as a business layer to consolidate calls to entity beans. Though you have local interfaces, I think coarse grained objects are still a better way to send information from the facade to the client.
You would have to make a call on whether you want to use composite entity pattern or not. There is no wrong way, choose what you feel is appropriate for the situation.
Thank you for the reply. If I understand you correctly, does it mean that if I usese Session Facade pattern (as business layer and implements the session bean as REMOTE), all the entity beans can be designed as Local ? --- even if it is in the clustered environment (since all calls will go through the session bean and the session bean is REMOTE)