简体   繁体   English

会话Bean和实体Bean以及有状态会话Bean和无状态会话Bean之间的区别

[英]Differences between session beans and entity beans, and stateful session beans and stateless session beans

I use SSH for a some while, and some friends ask me what is bean, and difference between session bean and entity bean, and difference between stateful session bean and stateless session bean, is those concept only exists in EJB(I also want to ask is EJB some relation with SSH), or they are general concept? 我使用SSH一段时间,有些朋友问我什么是bean,会话bean和实体bean之间的区别以及有状态会话bean和无状态会话bean之间的区别是那些概念仅存在于EJB中(我也想问一问。 EJB与SSH有关系吗?还是它们是一般概念? and what are they? 他们是什么?

what i mean SSH is Spring Struts and Hibernate, actually i do not know they three has some relationship with EJB? 我的意思是SSH是Spring Struts和Hibernate,实际上我不知道它们三个与EJB有关系吗?

And i want to know is that bean is concept in the context of EJB? 我想知道bean是EJB上下文中的概念吗? And when we talks about other framework like SSH, we never said bean? 当我们谈论诸如SSH之类的其他框架时,我们从未说过bean?

what is bean 什么是豆

In context of EJB, bean is a class managed by the container. 在EJB上下文中,bean是由容器管理的类。

between session bean and entity bean 在会话bean和实体bean之间

Session beans represent logic while entity beans represented persistent objects. 会话bean代表逻辑,而实体bean代表持久对象。 These days entity beans aren't used anymore in favour to JPA entities. 如今,不再使用实体bean来支持JPA实体。

difference between stateful session bean and stateless session bean 有状态会话bean和无状态会话bean之间的区别

Once you obtain a reference to stateful session bean, you will always use that particular instance. 一旦获得对有状态会话Bean的引用,就将始终使用该特定实例。 Stateless session beans are pooled and returned to the clients at random. 无状态会话Bean被合并并随机返回给客户机。

those concept only exists in EJB 这些概念仅存在于EJB中

Yes, although beans are also present in Spring framework with a similar meaning but different design concepts. 是的,尽管Spring框架中也存在bean,它们的含义相似,但设计概念不同。

is EJB some relation with SSH EJB与SSH有关系吗

You can deploy EJBs via SSH using SCP. 您可以使用SCP通过SSH部署EJB。 But seriously, seems like you are confusing SSH with...? 但是说真的,似乎您将SSH与...混淆了吗?

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

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