Active Object
Encyclopedia
The active object design pattern
Design pattern
A design pattern in architecture and computer science is a formal way of documenting a solution to a design problem in a particular field of expertise. The idea was introduced by the architect Christopher Alexander in the field of architecture and has been adapted for various other disciplines,...

 decouples method execution from method invocation that reside in their own thread of control. The goal is to introduce concurrency
Concurrency (computer science)
In computer science, concurrency is a property of systems in which several computations are executing simultaneously, and potentially interacting with each other...

, by using asynchronous method invocation
Asynchronous method invocation
In object-oriented programming, asynchronous method invocation , also known as asynchronous method calls or asynchronous pattern is a design pattern for asynchronous invocation of potentially long-running methods of an object.It is equivalent to the IOU pattern described in 1996 by Allan...

 and a scheduler
Scheduling (computing)
In computer science, a scheduling is the method by which threads, processes or data flows are given access to system resources . This is usually done to load balance a system effectively or achieve a target quality of service...

 for handling requests.

The pattern consists of six elements:
  • A proxy
    Proxy pattern
    In computer programming, the proxy pattern is a software design pattern.A proxy, in its most general form, is a class functioning as an interface to something else...

    , which provides an interface towards clients with publicly accessible methods.
  • An interface which defines the method request on an active object.
  • A list of pending requests from clients.
  • A scheduler
    Scheduling (computing)
    In computer science, a scheduling is the method by which threads, processes or data flows are given access to system resources . This is usually done to load balance a system effectively or achieve a target quality of service...

    , which decides which request to execute next.
  • The implementation of the active object method.
  • A callback
    Callback (computer science)
    In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other code. This allows a lower-level software layer to call a subroutine defined in a higher-level layer....

     or variable for the client to receive the result.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK