Its a battle between seeion beans and entity beans
Can any one tell me that why do i use an entity bean if i can provide persitence in my session bean itself
Its a battle between seeion beans and entity beans
Can any one tell me that why do i use an entity bean if i can provide persitence in my session bean itself
and also which is better cmp or bmp
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Its a battle between seeion beans and entity beans
Can any one tell me that why do i use an entity bean if i can provide persitence in my session bean itself
In general, you should use a session bean if the following circumstances hold:
At any given time, only one client has access to the bean instance.
The state of the bean is not persistent, existing only for a short period (perhaps a few hours).
The bean implements a Web service.
Stateful session beans are appropriate if any of the following conditions are true:
The bean's state represents the interaction between the bean and a specific client.
The bean needs to hold information about the client across method invocations.
The bean mediates between the client and the other components of the application, presenting a simplified view to the client.
Behind the scenes, the bean manages the work flow of several enterprise beans. For an example, see the AccountControllerBean session bean in Chapter 36.
To improve performance, you might choose a stateless session bean if it has any of these traits:
The bean's state has no data for a specific client.
In a single method invocation, the bean performs a generic task for all clients. For example, you might use a stateless session bean to send an email that confirms an online order.
The bean fetches from a database a set of read-only data that is often used by clients. Such a bean, for example, could retrieve the table rows that represent the products that are on sale this month.
You should probably use an entity bean under the following conditions:
The bean represents a business entity and not a procedure. For example, CreditCardBean would be an entity bean, but CreditCardVerifierBean would be a session bean.
The bean's state must be persistent. If the bean instance terminates or if the Application Server is shut down, the bean's state still exists in persistent storage (a database).
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |