JSF 会话 Bean 最佳实践
我正在开发一个在海外编写的 JSF 应用程序,它存在一些性能问题。
我一直试图理解为什么应用程序可能运行缓慢,并且我注意到每个支持 bean 都是会话范围的,并且许多 bean 使用其他 bean,因此它们可能都已实例化。
可能有 40 个支持 bean,每个支持 bean 包含大约 4000 行代码和大量移动部件。
有人可以证实或否认我的预感,即每次会话中的所有这些废话都会使应用程序变得缓慢吗?
I am working on a JSF application that was written overseas and it has some performance issues.
Ive been trying to understand why the application might run slow and ive noticed that every backing bean is session scoped, and many beans use other beans, so they are likely all instantiated.
There are maybe 40 backing beans each containing around 4000 lines of code and lots of moving parts.
Can someone confirm or deny my hunch that all this crap in each session is making the application sluggish?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为这可能是性能问题的原因。会话范围的 Bean 只为会话创建一次。因此后续请求不会创建这些 bean 的新实例。但当然,让所有 beans 会话范围都远离良好实践! :-)
I don't think that this may be the cause of performance issues. Session scoped beans are only created once for a session. So subsequent requests won't create new instances of these beans. But of cause making all beans session scoped is far away from good practice! :-)