I am a newer of EJB. Could you tell me what's the difference between Entity EJB and Session EJB. And why should we use EJB in web application. If you guys can give me some example. That would be great.
1. Reason for using the EJB: a. To seperate the Business logic. b. To create a Distributed component. c. To maintain the security, transaction, naming services by the EJB container. Here in this case we don't need to bother about the above said criteria. 2. Difference between Entity Bean and Session Bean: a. Entity Bean acts as a model for real time objects. i.e. Any real time objects can be a entity bean which persists the data in the storage medium. b. Session bean is extends to the client action. i.e. It will the decide the work flow. It won't be stored in the storage medium. Regards, M.S.Raman.
Joined: Apr 04, 2002
thanks Malli Subramanian Raman! Actually, i am doing a web application projects. I want to write codes about maintain customer's information and order information which is stored in database. Is it necessary to write EJB for these manipulation?(such as OrderBean, CustomerBean) If necessary, session or entity EJB should i use?
Hi. You probably want to read one of the many good books on EJB architecture. I would suggest "Core J2EE" by Deepak Alur, et. al., or "EBJ Design Patterns" by Floyd Marinescu. In the meantime, take a look at this article and this article for a little more guidance. Another good source of information is the Sun Blueprints for J2EE. All of the resource referenced above should help clarify your understanding of the proper role and use of each type of EJB. Kyle