• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why the exam name is BCD?

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BCD - Business Component Developement. I hope I am Right.

I think, I write business logic in my *simple* java class also (model), then why EJB is known as business component??

Thanks a lot.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I write business logic in my *simple* java class also (model), then why EJB is known as business component??

This is because EJB holds the business logic, while Servlets and JSPs hold the presentation logic. Session Beans provide workflow and Entity Beans provide data for the business operations.

Simple java class can provide limited functions. For example, how did you impose security checkings, transactional operations to your simple java class? You have to implement them on your own. However, by the specification of EJB 2.0, the container will handle all these.

In addition, java classes will normally be invoked (called) directly via other java classes, this exploses the business objects to others. For EJBs, all calls are handled by the "body guard" and the body guard will pass the corresponding data and operations to the bean and return the result to the callers.

Nick
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Nick for nice explanation.


while Servlets and JSPs hold the presentation logic


But I think, Servlet is controller and JSP handles presentation, if we refer to MVC.

Please clear my confusion...

Thanks a lot again.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet is controller and JSP handles presentation, if we refer to MVC.

It depends on what "components" the system used. If there are no EJBs, usually, Servlet itself will process the business logic, like perform transfer operations and then interact with the database, etc.

But if you make use of EJBs, most likely Servlet will be purely used for "Controller" purpose only, i.e. to look up the corresponding business component and then forward the request to there for further process, or received the result from business componets and look up which view to be used for display. And EJBs will be responsible for performing business operations.

That's why you can see the "definition" from SUN, Serlvets and JSPs are regarded as Web components (SCWCD) while EJBs are regarded as Business components (SCBCD).

Nick
[ July 26, 2005: Message edited by: Nicholas Cheung ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic