Hello !
Extending the idea from "Astral Cloning" pattern published
on javaworld.com, I am trying to solve a design issue
to achieve centralized implementation of business methods
by using entity bean implementation in transactional
and non-transactional contexts.
Example patten involves following elements :
Customer - Business Interface
CustomerEJB implements Customer - Entity Bean
CustomerSearchEJB - Stateless session bean to
create readOnly ( non tran
sactioanl non entity bean
data by using entity bean
implementation as plain
java objects )
CustomerUpdateService - Stateful session bean
for updating Customer
record. Uses CustomerEJB
as entity bean.
Now as a web client, if information is required
for displaying a list of customers ( without any
transactional context associate with it ), the client
would call CustomerSearchEJB which would use CustomerEJB
as a plain java object.
If client or CustomerUpdateService needs to use
CustomerEJB as entityBean, client would call appropriate
CustomerHome lookup to get a remote handle for CustomerEJB.
I have tested this pattern for basic funcationality and it
works fine. This enables to have centralized implementation
of business methods in entity bean independent of if
it is used as "entity bean" or a plain java object with
ability to sync state of entity bean with astral clone.
Does anyone see any problems with this approach ??
Thanks,
-Sudarshan
-
Using Entity Beans as plain java objects.. (1 messages)
- Posted by: Sudu Mahabal
- Posted on: December 18 2000 14:43 EST
Threaded Messages (1)
- Using Entity Beans as plain java objects.. by glenn dickson on August 06 2001 12:36 EDT
-
Using Entity Beans as plain java objects..[ Go to top ]
- Posted by: glenn dickson
- Posted on: August 06 2001 12:36 EDT
- in response to Sudu Mahabal
I have a problem, when I return my bean using the getAstralClone it gives me a classCastException, do you get this.
I am using j2ee 1.3 cmp2.0.
Thanks
Glenn