Which is the best practice for use EJB and Hibernate in a multi layer application (WEB,Logic, Data/Model)? I would use EJB 3.0 and i thought that use Entities managed by Hibernate and Staless Session Beans that implements the application logic is good. The dubt is about the interaction Web-Logic in which i would pass directly as session beans response entity object (detached) like simple beans that the view can use without problems. Is more correct to divide completly the view from the logic implementing other beans or is this the correct way(use directly entities like beans)? In the first case, what i can do for divide it? Exist a pattern that i can use or an API that can help me to do this? In the second case, how i can pack the model+logic in a EAR and the WEB in another? The problem is that web need Session interfaces and bean classes.
I hope you can help me Thanks
Best regard R
|