Discussions

EJB design: best practice to transfer data back to web tier

  1. best practice to transfer data back to web tier (2 messages)

    Ejb business method implementation question My application is two tier app tier and web tier .Web server has no database access so any request to database should got to appserver. I am confused about the implementation of business method. Need to know best practices. I have a businessObject Public interface IEmployee { Public getEmployeName(); } Public CustomEmployee implements IEmployee { Private String name; CustomEmployee(){ name=// call to dao get employee name } Public getEmployeName(){ return name; } } My session bean creates instance of new CustomEmployee and return IEmployee. My question should I use DTO to transfer data back to web tier or just return instance of IEmployee ? Want to follow best practices.
  2. best practices business method[ Go to top ]

    Always its best to use DTO to tranfer data to and fro, while communication is happening between multiple tires.
  3. I came across a nice webpage based on this specific discussion It is DAO explained http://question2answer.googlepages.com/data-access-object-DAO.html Hope this helps.