Originally posted by chandrasekhar muvvala:
In HFEJB Book at page 108, i did'nt understand the concept "Represents a process" ? can anybody explain please !...............
Let me try to explain. Before that do not forget to remember that a Session Bean represents a "process" and an entity bean represents a "thing" or "entity".
That means a session bean will do some job and may use entity beans (data) to convincingly accomplish the job. For instance, you may have a session bean (TellerBean) that performs the operation of a bank teller. Performing the operation of a teller is a process. To do this, the TellerBean needs Account, which can be modelled as an entity bean. In other way, the TellerBean uses Account to perform processes - processes like credit, debit, etc on an Account (our entity bean).
TellerBean (session bean)
- credit()
- debit()
Account (entity bean)
- getAccountNumber()
- getBalance()
- getHolderName()
As you might have observed from the above class model, an entity bean exposes methods that are primarily data-oriented. But the TellerBean is more intelligent in a way it knows how to play with entity beans and perform *real" operations, what are called processes. In this case, it does credit() and debit() processes.
Certain *things* are required to do a process. Model those *things* as entity beans. A process can be modelled as a method (stateless) or a group of co-ordinating methods (stateful) in a Session bean.
Hope it helps.