This is somewhat of a design question. I am using the decorator pattern to handle cross-cutting concerns. One of these concerns is validation. Most of the examples I have seen do something like:
IAccount account = new AccountValidator(new Account());
account.Deposit();
and the implementation of the validator is something like:
if (!IsValid)
throw new NotValidException();
overly simplistic, but hopefully you get the idea.
I had the impression this was bad practice (I could be wrong, that's the heart of my question really - is this bad practice?) The case isn't really an exception. It is a fairly typical and understandable user input error.
However, the only way I know how to avoid this kind of situation is to engineer all my service methods to return some kind of standardized object containing response data. So for example account.Deposit() returns an IResponse which is implemented by a number of possible classes, such as NotValidResponse : IResponse...
Thoughts?