Hi john
I am new to EJB and am groping for some patterns to design my system using
entity & session beans. Can u explain what u meant by domain objects?? I was
planning to have serializable value objects to get the data from entity
beans at one shot and to set values to entity beans in one shot --- to
improve performance --- something like coarse grained methods. But not sure
whether I am going the right way. With ur post I am confused again. What are
domain objects in ur design --- are they the value objects???
Also I am not sure as to how I am supposed to handle big/small queries from
my jsp client --- something like user tries to find some match --- say all
the products in the system --- now is it right to call a product entuty
beans finder methods to do this type of query or should we just ask a
session bean to perform the query and return the value objects or the
servlet directly fiers the query to retreive the data. Which is the best
way??? In case of large data the first option will be definitely a poor
choice. What do u do when u face such situations???
Any help appreciated.
TIA
Anamitra

-----Original Message-----
From: john smith [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 13, 2000 11:05 AM
To: [EMAIL PROTECTED]
Subject: EJB Design: entity beans and domain objects


We want to take advantage of entity beans and CMP, but also want to preserve
our Domain Object Model to the greatest degree possible. It is sometimes
suggested that an entity bean simply wraps the java object. The entity bean
would then have two attributes of interest to us, the id, and a reference to
the java object it represents.

Thus we never really act on the entity bean, instead we get the domain
object from it, act upon it and give it back to the entity bean to persist.

We may also do "large" queries using sql in session beans, construct our
domain objects from the results, and when done, pass them back to an entity
bean for transactional updates.

I would like to expose only the domain objects to the clients (session
beans) probably using a facade of some sort with which our "findBy" requests
would be delegated to the actual entity bean and the facade would return
back to the client, domain objects.


Questions:

First - I'd like to know if anyone is using domain objects wrapped by entity
beans, and if so, can you provide some insight into how you actually use the
domain object from a client. Thoughts?


Heres the first thing I come up with:
Lets say we want to use a simple mutator on a domain object, for example,
change a patients telephone number.

1 - the client makes a request for patient with last name of smith.

2 - If we were directly accessing entity beans from the client (session
bean) we would have 3 remote references, update the one of interest and the
container would insure it was persisted...

In our case we get back three domain objects. We update the one of interest,
and then what??? Sure, we submit it back for persistence. The facade will
use the id to look up the entitybean, update it and persist it. But this
seems like a lot of work!

Any other ideas?

THANKS!!!




8^)



______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to