• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB-2 Doubts -Traeting session bean as a class  RSS feed

 
Abhi Venu
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using a session bean with Facde design pattern

Have follwoing interfaces and classes FacadeTestHome,FacadeTestLocal,FacadeTestBean

Also my enity bean are the following MyentityHome, MyentityLocal,MyentityBean,

I usaully calls the methods of enity from my session bean class after getting the home object.

Now i have another utility class My doubt is what is wrong with calling session bean clas like this i.e treating it as a class

FacadeTestBean sessionBeanObj = new FacadeTestBean();

and calling its method

Please point out the pitfalls in it

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37256
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhi Venu wrote: Now i have another utility class My doubt is what is wrong with calling session bean clas like this i.e treating it as a class

FacadeTestBean sessionBeanObj = new FacadeTestBean();

and calling its method

Please point out the pitfalls in it


This is calling Java code. It is not calling it as a session bean. As a result you don't get any of the benefits of using a session bean. No transactions. No security. No benefits over a Java class. In other words, there is no point in pretending it is an EJB if it is called as a POJO.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!