简体   繁体   中英

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? 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?

And i want to know is that bean is concept in the context of EJB? And when we talks about other framework like SSH, we never said bean?

what is bean

In context of EJB, bean is a class managed by the container.

between session bean and entity bean

Session beans represent logic while entity beans represented persistent objects. These days entity beans aren't used anymore in favour to JPA entities.

difference between stateful session bean and stateless session bean

Once you obtain a reference to stateful session bean, you will always use that particular instance. Stateless session beans are pooled and returned to the clients at random.

those concept only exists in EJB

Yes, although beans are also present in Spring framework with a similar meaning but different design concepts.

is EJB some relation with SSH

You can deploy EJBs via SSH using SCP. But seriously, seems like you are confusing SSH with...?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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