Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

To EJB or not to EJB

 
saahil sinha
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have this one problem i am developing an application where the user enters data into database and the admin can view edit and delete data.The users can be of different types.He can be "type a" where certain set of info abt him is fetched of "type b" where another set of info is fetched or of "type c".
What i would like to know is does it make sense if i fetch form elements into a servlet and then perform the viewing and editin and deleting of data in EJB by calling the EJB from within servlet or should i perform the database transactions within the servlet.
I was thinkin of using EJB just to practice how it works but i would like to know in a real world scenario if this application is for a small company where only abt 2 ppl will do the admin role and the data of the users is also entered by a single person in tht case what is better to use servlet only or servlet in conjunction with EJB :roll:
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked this article?
http://www.javaworld.com/javaworld/jw-12-2001/jw-1207-yesnoejb.html

]Rules for choosing EJB
Choose EJB when you know your application will need to scale beyond initial low usage levels and support multiple, concurrent users.
Choose EJB if you need transaction management. For online catalogues or read-only systems with low user numbers, you probably don't need EJB. For financial systems or any system where you must preserve the ACID (atomicity, consistency, isolation, and durability) properties, EJBs are a must.
Choose EJB if you need a comprehensive security model.

you can make your own conclusions after reading the whole article.. Check out the example at the end of the article..
hope it helps
cheers...
 
saahil sinha
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot for the help andres
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!