Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

loose class and EJB difference

 
Nelson Nadal
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope this is not really an intermediate question.
If a loose class is called from JSP or servlets is that consider as Java Beans?
What is the difference of it from EJB? in what aspect? Is it the setXXX and getXXX standard?
What is the use of EJB that can't do by usual Java Bean? Thanks, I just want to enlighten on this matter, thank you.
 
vikasids sharma
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Nelson
if u use a simple class in ur jsp by using <jsp:useBean>, u would be using it as so called server side java Beans.
Originally posted by Nelson Nadal:

If a loose class is called from JSP or servlets is that consider as Java Beans?


What is the difference of it from EJB? in what aspect? Is it the setXXX and getXXX standard?

you may or may not have getter methods corresponding to setter methods in javabeans(well depends upon the requirements )EJB does nt differentiate itself by getXXX and setXXX standards.

What is the use of EJB that can't do by usual Java Bean? Thanks, I just want to enlighten on this matter, thank you.

Usual javabeans are instantiated by developer itself.so if developer wants to incarporate services like persistence , transaction, instance pooling in application.he needs to call all these respective APIs(explicitly ) to get it services enabled.
EJBs are instantiated by container itself , it creates request interceptor for each EJB(Enterprize java bean) deployed which provides all these above services implicitly. Here developer is concerned with providing business logic rather than writing explicitly to transaction, security etc APIs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic