Thanks, Peter.  I was referring to the DAO pattern in "Core J2EE Patterns"
(which also discusses the Business Delegate pattern), but I just ordered
Leas' book from Amazon.  Hope to have more discussions along these lines
after reading it.

Mark

-----Original Message-----
From: Peter Huber
Sent: Wednesday, December 12, 2001 9:36 AM

No, I did mean 'Active Object' as it was described in 'Pattern-Oriented
Software Architecture / Patterns for Concurrent and Networked Objects'
or in Doug Leas book

Say you start with suns J2EE blueprints and the BusinessDelegate Pattern
(the BusinessDelegate is the on who calls the ejb you don't call it from
servlet directly).
Make this BusinessDelegate an Active Object. An Active Object receives
requests and handles them somewhat independend of the normal program
flow, it's like a object-with-a-thread.
You might ask 'what about the results'. Use 'Future' here. A future is a
result placeholder. Immediatley after the call:

myFuture = anActiveObjProxy.doXYZ(paramlist); (this call places only a
message on the actives Object request queue, the call returns
immediately)

myFuture does contain nothing.

To have parallelism, you have a bunch of those calls one after the other
and therefore a bunch of futures.

After the bunch of calls, you must wait until all futures are filled
with results from their actve objects, but that happens in the
background (remember the active object uses it's own thread). In the
meantime you can do other *usefull* things. Afterwards you simply
collect the results. use some sort of wait-loop inside the future like:

public synchronized Object get() {
  while(realResult==null) wait();
  return realResult;
}

this means that you also have some method like

public synchronized set(Object o) {
  realResult=o;
  notifyAll();
}

Peter


----- Original Message -----
From: Mark Galbreath <[EMAIL PROTECTED]>
Date: Wednesday, December 12, 2001 2:35 pm
> Did he mean "Data Access Object" in conjunction with a thread pool
> (maintained by the database)?
>
> Mark

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to