Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Finder methods  RSS feed

 
ALaxmi Shankaran
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can the finder methods be called from the servlet.

Which is the better option 1) calling them directly from servlet
2) write a wrapper method in session beanto call them ?

Why?
 
Amit Jaipaul
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is no harm in calling finder method from a servlet. We can very well call them from servlet.

It is better to call Entity Bean finder methods from Session Bean and put the corresponding values of the business object into a value object and pass it to the client.
 
unni krishna
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ENTITY BEANS SHOULD NEVER BE EXPOSED TO CLIENT. ALWAYS USE IT THRU A SESSION BEAN.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that Unni is talking about the Session Fa´┐Żade J2EE pattern:

Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!