- Given these differences, here are some rules of thumb
- Domain objects are almost always entity beans
- Any object that you want to find based on attributes must be an entity bean
- Any object that will be shared must be an entity beans
- An object that bundles together operations on entity beans is probably a session bean
- An object that has no database state is a session bean
- An object who lifetime is not explicitly managed should be a session bean
- An object that contains code that could be residing in the client is probably a session bean
- Design strategy
- First Cut: Identify the obvious entity beans and make everything else a session bean
|