Marcus Ahnve wrote:
> Interesting thought, I assume you mean having the session bean calling a local
> object wrapping the entity bean, with the session bean still acting as the remote
> facade.
Hmm. Actually, when I wrote the message I meant something even more
decoupled than this. Using a bastardized version of Richard's book
examples, TravelAgent would simply be a java object, and would
correspond one-for-one with your first crack at a domain model in UML.
The decision would come later whether or not you wanted to implement its
work via a session bean "under the covers".
So you'd have code like this:
public class TravelAgent extends NothingInParticular {
public void bookPassageOrWhatever(int someParam, Person person) {
// want to implement this using EJB? Then do this:
TravelAgentRI ta = // go do that JNDI voodoo...
ta.bookPassageOrWhatever(someParam, person);
}
}
public class Person extends YourMother {
// care to implement this with an entity bean? Fine:
PersonRI impl = // JNDI stuff
public Person(String name) {
// create impl if not created
impl.setName(impl);
}
}
The point here is that EJB is an implementation technology and has so
many weird design quirks/flaws that its requirements should not make it
into your domain model. Also, the common practice of somehow mystically
grouping domain objects together under, say, an entity bean facade is
not (a) easy or (b) practical in most cases (at least IMHO). So all I'm
saying is: what if you did it the other way? What if you stick an
entity bean under a regular java object "facade" (I use quotes because
it's not really a true Facade in the Design Patterns sense)? And as
long as you're doing that, why not shove session beans under regular
java object facades as well?
I'm sure there are flaws I haven't thought of. This is the product of
only a couple days of thought.
Hope this clarifies my (tentative!) thinking a bit.
Cheers,
Laird
===========================================================================
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".