|
|
Darren New <dne### [at] sanrrcom> wrote:
> Yeah. The person I saw advocating this also recommended command/query
> separation, so anything that sets a parameter wouldn't be able to return a
> value.
So if setting a parameter to a given value can fail, you can't check
the success/failure of the function call by having the function return
eg. a boolean value informing of this, but instead you have to write a
separate function which you have to call in order to query whether the
operation was successful or not? And this for each such parameter which
can fail?
This presents a multitude of problems. For instance, the class would
have to store booleans for each parameter somewhere, so that the "did
the setting of that parameter succeed?" function can return it.
What if the success query function is called *before* the setting of
the parameter function is called? Can the return value have a meaningful
interpretation anymore?
--
- Warp
Post a reply to this message
|
|