my question is rather architectural in connection with EJB 3.0 and higher versions with multi-tier applications.
Background: What do you think the best solution would be to pass data from the database over the session facade to the presentation tier? The entity classes detached would offer for me an attractive solution but in this case they should be specified as argument types in the session facade methods. Consequently, the enity classes should also be given to the presentation tier or any other client as a jar that would like to connect to the session facade. Somehow I don't feel it is the right way because they contain much more that the presentation tier should be aware of but I am not sure as they are detached and light-weight classes and represent also the relationships and contain also the related collections of classes what could spare a lot of work with transfer objects to rewrap them.
Question: Pre-EJB 3.0, in the age of the enity beans, the data should have been rewrapped in Transfer Objects and the Transfer Object Assembler design pattarn could also have been used to build the complex data structures to model n-m or 1-n relationships. However, the entity classes are much more light-weigth and we could spare this rewrapping. What do you propose for providing the data to the presentation tier, how do you do it usually?
Thank you a lot for your response. Kind Regards, Tamas