Alok Srivastava

+ Follow
since May 14, 2001
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Alok Srivastava

Hi parmeet thanks for your justification of using EJB over servlets. If for a moment u ignore these fancy words like "transaction monitoring","content management","distributed object model" and come to the ground reality of actual code development, what are the issues involved...??? Firstly if i am using BMP(bean managed persistence) i have to write actual sql queries.. as i need to do in a servlet... but in addition i have to make a remote, home and PKclass, deployment descriptors.. which is definetly an overhead. As far as locking on databse access is concerned in case of different users accessing the same database, i think almost all of the rlational dtabse, like Oracle, sybase etc. provides this feature. so i don't need to bother about this whether i do my job thru' a servlet or EJB. Now if am using a CMP(container managed persistence) how do i make join queries involving multiple tables... for that i will need a tool like toplink to handle that issue, whihc i definetly don't need in case of servlets. Futher more.. as far as interaction between beans from different JVM's are concerned, how do i do that.. without adding anything to my code..??? its impossible... what i need is an RMI.. which i can do even in case of servlets...
So if i think from the coding perspective i find.. the EJB approach more complicated... !!!

Is it possible to have more than one remote interface for an entity bean.....???
basically i am thinking that way... because... consider a case:
there are two users A and B, for a typical banking application.
A is the account holder in a bank..... who has the authority to simply view the acc. balance.
B is the bank employee.... who has the authority to update as well as view the account balance.
i want to have a single entity bean,,"AccInfoBean"
now the remote interface that should be invoked should depend on the user... of the bean.... i.e. two different functionalities.. and correspondingly two different remote interfaces....???
i was just thinking is it any how possible...???by this we can reuse one entity bean for two functions.....!!!
one of the possible solutions could be... to check the user in the Bean object... and then allow or disallow the user to access a function depending on his identity(say login). But this definetly requires an interaction with some other database table.. to check the user details. For which i would have to invoke some method to interact with a table, for which the entity bean is not supposed to.
Why should i use EJB, when i can do all those functionalities using servlets..?? Even servlets provide me multi-thread model.. to cater to multiple users accessing my buisness logic. Furthermore, i can have a servlet directly talk to database, using a typical 3-tier architecture(UI->servlet->database), then why do i need to incorporate few more layers..(UI->servlets->session-beans->entitybeans->databse). I basically want to know what are the performance advantages of using so many components when a single servlet can serve my purpose.