Comparing Entity Beans and Session Beans

Entity beans differ from session beans in several ways. Entity beans are persistent, allow shared access, have primary keys, and may participate in relationships with other entity beans. Table 8.1 shows the differences between session and entity beans.

Table 8.1. Differences Between Session and Entity Beans
Session BeanEntity Bean
Typically contains business process logic, such as sending an e-mail, looking up the stock price from a database, implementing compression and encryption algorithms. They also implement business logic such as workflow, algorithms, and business rules.Typically represents business entities, such as customers, products, accounts, and orders.
Executes a particular business task on behalf of a single client during a single session.Can be shared by multiple clients.
The state is not persistent.The state is persistent.
Usually does not correspond directly to data.Usually corresponds directly to data.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.181.36