> > a useful feature for *any* iterative algorithm would be the
> > possibility to call a "monitor" at the end of each iteration. What
> > would this monitor do would pretty much depend on the user's mood:
> > periodically backup the state of the algorithm (in order to restart it
> > in case of a crash), log a set of tabulated values (to plot the
> > convergence of the algorithm), ...
> > The idea would be to come up with a design as general as possible.
> > Gilles proposed (see MATH-581) to use java.util.Observable. This
> > sounds very attractive to me. Any comments?
> 
> +1 to the idea of using the Observer pattern; but -0 for
> Observable.  I would favor defining Events and Listeners because a)
> Observable is concrete, so effectively forces you to create an
> Observable delegate and b) the interface is crude and is really
> designed for GUI scenarios where observers are holding references to
> the Observable and just being notified that something has changed. 

Indeed, that would be all that is necessary for a simple home-made
monitoring solution.
I fear that a more complex functionality would entail reinventing the wheel.

> Events are more flexible and can be implemented using interfaces. 
> Has anyone ever actually used Observable outside of a GUI m/v
> environment?

Hmm, that would be me.

>   Does anyone know of event frameworks suitable for
> monitoring long-running computations that we might adapt?

I must raise the issue again:
  s/adapt/use/

> In any case, I think it is a good idea to develop an event framework
> for [math].  We should probably also think about doing this in a way
> that is at least JMX-friendly.

I don't know anything about JMX.


Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to