Name: Anonymous 2009-10-06 8:46
So I'm writing a program to do some media conversion. As the media is being processed, I want the subroutines to report back how far along the processes is, any warnings encountered, and of course any errors that occur.
Since the program can be used with a gui or command-line, I want that feedback pipe interchangeable. But what is the best to implement that?
Should I pass a 'feedback object' to all subroutines that need to provide feedback? This would be a hassle, but would allow for multi-threaded tasks.
Or should there be a global singleton-type object that all subroutines can statically access. All feedback is piped to whatever global feedback object is registered. This would be easier, but removes the option for multi-threaded feedback pipes.
Any thoughts /prog/?
Since the program can be used with a gui or command-line, I want that feedback pipe interchangeable. But what is the best to implement that?
Should I pass a 'feedback object' to all subroutines that need to provide feedback? This would be a hassle, but would allow for multi-threaded tasks.
Or should there be a global singleton-type object that all subroutines can statically access. All feedback is piped to whatever global feedback object is registered. This would be easier, but removes the option for multi-threaded feedback pipes.
Any thoughts /prog/?