Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where should we use EJB???

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a Web Project but we are not using EJBs in that, so I want to know in what cases (conditions) we should use EJBs in our project. I am sure there must be some situation where only EJB will help not any other thing...

Thanks a lot.
[ November 23, 2005: Message edited by: rathi ji ]
 
satishkumar janakiraman
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

You should consider enterprise beans if your application has any of the following requirements.
The Application must be scalable
Transactions must ensure data integrity
The application will have a variety of clients

For better understanding, read sun tutorials

bye for now
sat
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The application will have a variety of clients


Are you mean to say: browser client (Web site), mobile client (WAP site) etc.

How does EJB can help in this??

Please comment.

Thanks.
[ July 28, 2005: Message edited by: rathi ji ]
 
bhilla ratna
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this article helps you to know why to use EJB and when to use.

http://www.developer.com/java/ejb/article.php/10931_1434371_2
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB is usually used for distributed environment, as it aims to support such transactions. Since the container provides you almost every important functions, transaction handling, exception handling, security, resources allocation, developers do not require to write additional codes for them.

In addition, you can use JNDI to look up the EJB services, so that the series of business operations are hidden from the callers.

Nick
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this article helps you to know why to use EJB and when to use.

http://www.developer.com/java/ejb/article.php/10931_1434371_2

One more point to add to the article: Separation of Business Logic from UI and Data Access

EJB aims to achieve this purpose, however, JSF aims to link up the UI components with backend. And you can see that JSF is included in J2EE 1.4 specification.

Nick
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nick,

You used a word transaction, whenever we want to do transaction, we use EJBs. Please can you explain what actually is transaction here..

Thanks a lot.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You used a word transaction, whenever we want to do transaction, we use EJBs. Please can you explain what actually is transaction here..

Transactions refer to database operations. It is not necessary to use EJB whenever the system involves in transactions. It depends on the actual needs. For small/single transactions, we might simply use JDBC. But if we have to cater for complicated transactions, like a sequential updated operations and they should be regarded as a single transaction unit, using EJB might reduce the complexity of such handling.

Nick
[ July 28, 2005: Message edited by: Nicholas Cheung ]
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This may be useful.
http://www.coderanch.com/t/316680/EJB-JEE/java/EJB-vs-Spring
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Nick and all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic