We are as a team working on a project which currently using WCF as in between client and server.
All business rules are written on managers classes which are used by service so its means no validation rule will be on client side (for example duplicate user name )
so far in case of duplicate user name validation fails we throw faultException from service and use those fault Exceptions can be used by client to check why that operation is failed.
Now my manager wants that we should not use faultException. he has following points
- Exception throwing for validation messages is not a good approach.
- EXception throw and catch take more time .
- Everytime client must have to check faultException catch block before any other catch block
so he gave us idea to implement the methods of service with an extra parameter which will be ref type of error class object . any validation rule will be added to that ref type and client will check that ref first and if any error client can show validation message.
so my questions are
- really using faultException for business rules validation is bad practice ?
- what are cons of using ref varibales as parameter in service operation contracts ?
- What will be better approach if any other normally uses in programming world ?