aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes A newbie's question:  What functionality is put in EJBs, what in bus. classe? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "A newbie Watch "A newbie New topic
Author

A newbie's question: What functionality is put in EJBs, what in bus. classe?

Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I'm a newbie to EJB and had the following question:
What logic should be put in, for example, a session bean? Does a bean do more than handle requests, delegate those requests to business or utility classes, and return the results to the EJB client?
In other words, is an EJB in functionality something like a control servlet (except of course that responds to remote RMI and JNID calls to its interface?
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Session beans are generally used for exposing business logic encapsulated with a transactional context and security checks. People often delegate the actual business logic to plain old Java objects in order to facilitate easier testing. The bean shouldn't contain thousands of lines of code anyway...


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Mushtaq Ahmed
Greenhorn

Joined: Sep 01, 2003
Posts: 5
As far Functionality is concerned.
1.Servlet is used for writing Control logic
2.Session bean is used for handling Business logic.
3.Entity bean represents data (It maps to a record in database)
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
That's about it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A newbie's question: What functionality is put in EJBs, what in bus. classe?