posted 17 years ago
Sandya,
Arun has covered most of the things.. I would like to add some more examples to it.
Consider that you own a Online Book Shop, and you need to provide the following functionalities
1) Purchase a book
2) Update the customer's email address
3) Insert/Delete/Query books in the database.
4) Send weekly e-magazines to your subscribed customers
Stateful Session Beans
Functionality 1 is provided by the SFSB. Consider that a customer adds a book in his shopping cart, and then looks for the other books. Then he comes back and checks his shopping cart. If he finds it to be empty, it will be total mess. To avoid these issues, we go for a stateful session beans, which retains the conversational state with the client.
Stateless Session Beans
Functionality 2 is provided by the SLSB. Customer updating the email address is a one time request and it is not required for the bean to remember the client's previous conversation.
Entity Beans
Functionality 3 is provided by the Entity Bean. Entity Beans generally represent a row in database table. It can combine data from mutliple tables, but as of now leave this. You can do the same task with normal JBDC, but you need to look after the transaction management, security and all other stuffs, which your container already provides for the entity beans.
Message Driven Beans
Functionality 4 is provided by the MDB. This is basically an asynchronous communication.
When the world says, "Give up,"<br />Hope whispers, "Try it one more time."