简体   繁体   English

EJB注入与仅JSF托管bean

[英]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. 我有我的JSF + Tomcat应用程序,它运行得很好。 I want to implement Restful services and JAAS logic. 我想实现Restful服务和JAAS逻辑。 In order to do that, I switched to TomEE++. 为了做到这一点,我改用了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. 切换到TomEE意味着我的服务器现在会更加沉重,我担心它比我在Amazon AWS微实例中需要更多的cpuram资源。

The question is: Will the performance drop down if I switch from only JSF managed beans to JSF + EJB? 问题是:如果我只从JSF托管bean切换到JSF + EJB,性能是否会下降?

The sub-question is: what EJB injections can do, and JSF managed beans can not do? 子问题是: EJB注入可以做什么,而JSF托管bean不能做什么? (JSF does not allow cyclic injections for example) (例如,JSF不允许循环注入)

Will the performance drop down if I switch from only JSF managed beans to JSF + EJB? 如果我只从JSF托管bean切换到JSF + EJB,性能是否会下降?

Measuring is knowing. 衡量就是知道。 But generally, this concern makes no sense. 但总的来说,这种担忧毫无意义。


what EJB injections can do, and JSF managed beans can not do? EJB注入可以做什么,而JSF托管bean不能做什么? (JSF does not allow cyclic injections for example) (例如,JSF不允许循环注入)

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). 您使用JSF bean管理注释来管理前端(JSF页面)的bean。 You use EJB bean management annotations to manage beans for business services (BOs/DAOs). 您使用EJB bean管理注释来管理业务服务(BO / DAO)的bean。 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 + EJB(+ JPA)应该如何协同工作,请转到以下答案中显示的具体示例和解释:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM