Active object design pattern ----- somewhat over hyped?

From: Generic Usenet Account (usenet_at_sta.samsung.com)
Date: 12/22/03


Date: 22 Dec 2003 14:34:01 -0800

For all these years I have, somewhat religiously, accepted the fact
that by providing a neat abstraction for threads in a multi-threaded
environment, the active object design pattern allows the threading
architecture of a process to be changed with minimal impact. I was
recently explaining this design pattern to a relatively inexperienced
team member in our group, who, unlike me, tends not to believe things
at face value. My colleague accepted my statement somewhat
skeptically, but he returned the next day and pointed out to a hole in
my understanding. He has now convinced me that the whole notion that
collaborators of active objects don't need to be aware of whether the
method they are invoking on the active object is getting invoked in
the collaborator's thread or the active object's intrinsic thread is
** over simplistic **.

While this claim is true for "asynchronous" method calls, it is not
true for blocking calls. When a collaborator makes a blocking method
call on an object, the focus of control passes (so as to speak) from
the collaborator to the object. The focus of control does not return
to the collaborator until the method has completed execution. Now, if
the object is suddenly made an active object, the method execution and
method invocation are decoupled. When the collaborator invokes the
method, the request is stored in an "activation list" and the focus of
control returns to the collaborator right away i.e. before the active
object actually processes the request in its intrinsic thread. There
may be situations where this distinction is not important, but to
emphatically claim that the thread in which the method is invoked is
transparent to the collaborator is a stretch.

Any thoughts?

Regards,
KP Bhat



Relevant Pages

  • Re: Active object design pattern ----- somewhat over hyped?
    ... the active object design pattern allows the threading ... When a collaborator makes a blocking method ... The focus of control does not return ...
    (comp.object)
  • Re: Active object design pattern ----- somewhat over hyped?
    ... the active object design pattern allows the threading ... > recently explaining this design pattern to a relatively inexperienced ... When a collaborator makes a blocking method ... The only reason the client thread would have to wait would be if the ...
    (comp.object)
  • Re: Active object design pattern ----- somewhat over hyped?
    ... Active Object cannot prevent the clients from knowing that there are ... calls to the threading API *inside* the called object. ... When a collaborator makes a blocking method ...
    (comp.object)
  • Re: IOleInPlaceSite::OnUIActivate failing in IE
    ... Finally worked out what the problem was here after debugging into IE. ... Basically my control class needed to have a data member "m_bEnabled" for the ... Activation on the control and thus allow the interception of keyboard ... provides for handling keystrokes in the currently UI active object. ...
    (microsoft.public.vc.atl)
  • Re: Automatically Input Date
    ... is a shorthand way to refer to the current active object, ... the control that holds the value for the date". ...
    (microsoft.public.access.forms)