On Mar 30, 2011, at 2:17 23AM, Martin Dias wrote:
Hello
I have a couple of algorithms and I want to show the progress while they run. I played with the progress bar and it's okay for my needs.
The progress bar should be pluggable and decoupled of the algorithms.
I am writing to you to ask about good designs for my problem. I hope I haven't expressed the problem in a too abstract way.
The design I have in mind is a kind of observer pattern: the serialization algorithm publishes information about the run; a specific listener implements the progress bar for that serialization algorithm, interpreting the information published.
Thanks, Martin
If my previous post wasn't crystal clear: I've used this pattern in the past, it works like a charm :) I'd recommend just using a simple progress bar widget though, and putting the pluggability at a different level. This is more of a pattern than a framework, it's hard to make a one-size-fits-all solution. Not to mention using a simple API for updating the widget itself makes it easier later on to substitute if you find a different visualization would be better. Cheers, Henry