Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB injections vs only JSF managed beans

I don't know may be my question is completely meaningless, but I can't find any straight information about it.

I had my JSF + Tomcat application and it worked just fine. I want to implement Restful services and JAAS logic. In order to do that, I switched to TomEE++.

Switching to TomEE means that my server will now be more heavy and I'm afraid than it will require more cpu and ram resources than I have in my Amazon AWS micro instance.

The question is: Will the performance drop down if I switch from only JSF managed beans to JSF + EJB?

The sub-question is: what EJB injections can do, and JSF managed beans can not do? (JSF does not allow cyclic injections for example)

like image 375
ZuzEL Avatar asked Jul 28 '13 13:07

ZuzEL


Video Answer


1 Answers

Will the performance drop down if I switch from only JSF managed beans to JSF + EJB?

Measuring is knowing. But generally, this concern makes no sense.


what EJB injections can do, and JSF managed beans can not do? (JSF does not allow cyclic injections for example)

Generally, they are not intented to be interchangeable. Each have their own clear responsibility. You use JSF bean management annotations to manage beans for front-end (JSF pages). You use EJB bean management annotations to manage beans for business services (BOs/DAOs). That's it.

To learn how JSF+EJB(+JPA) are supposed to work together head to the concrete examples and explanations shown in the following answers:

  • JSF Service Layer
  • JSF managed-bean EJB injection
  • Filter do not initialize EntityManager
  • JSF request scoped bean keeps recreating new Stateful session beans on every request?
like image 103
BalusC Avatar answered Nov 03 '22 01:11

BalusC