Nicholas Clark wrote:
On Thu, Sep 13, 2007 at 10:37:59PM -0700, Allison Randal wrote:

The conclusion after a good bit of discussion earlier this year was that returning a status object for every synchronous operation was far too heavyweight. Exceptions don't get a high vote as an alternative, but

Even if the success object (the common case) is a singleton?

Status objects always contain information unique to the particular operation (such as the return value, current progress on the operation, etc), so they can't be singletons. But, it's not so much a performance question (the cost of creating and storing the status object), as it is an interface question (the redundant code to retrieve and handle an additional return value).

The nature of status objects makes perfect sense for async ops, but isn't well adapted to synchronous ops, where you block waiting for the op to complete anyway, and don't need any info except the return value and a way to check success (or handle failure) after the op is completed.

Allison

Reply via email to