Can you please tell me if the usuage of Business Object in the following sequence is correct?
StatelessSession Bean ----> Business Object ----> Entity ----> EntityManager ----> DB
Basically, I'm confused on Business Object. SUN's Core J2ee Patterns Map says
Business Object implements Entity link -> [http://www.corej2eepatterns.com/Patterns2ndEd/index.htm]
But can I have Entity [as in EJB3] outside Business Object and have the Business Logic
in Business Object. For Example say a method in the StatelessSessionBean needs to
change the Status of two different Entities, can I use Business Object to change the status of
the Entities [like below]?
The StatelessSessionBean will pass the id of Entity1 to BusinessObject1 and the BusinessObject1
will look up for Entity1 in EntityManager and set the status and persist in the DB
And again StatelessSessionBean will pass the id of Entity2 to BusinessObject2 and the BusinessObject2
will look up for Entity2 in EntityManager and set the status and persist in the DB
Is this the correct usuage of Business Object? (i.e) Business Objects are used to perform
certain task on Entities [like changing the status].
OR is the above implementation Wrong in the sense that Business Object are the Entities themselves
and they should implement the Entities. Business Objects cannot be separate from Entities.
Please help me understand Business Objects and what are they used for and where to use them.
Also, kindly let me know if my question is not clear.