Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning an object back?
Message
 
 
To
20/02/2013 17:50:20
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01566475
Message ID:
01566617
Views:
44
>Throw an error and handle it elsewhere.
>
>>Would it be better to save error codes and messages in the class properties instead and not pass them as parameters by reference? Do you think it will be a step in the right direction?
>>
>>I just proposed this to our internal team as another developer found limitations with our current approach.

We need to handle error somewhere. It's easier to handle the error exactly where it occurred because the ultimate goal is to pass error message (formatted special way) to the other application. So, immediately after the error occurred we want to format that return message and stop all other processing of that method. I don't want to write a special logic in each method to handle the error.

So, I think our idea of returning Boolean indicating success is OK. My only question is - do you think that using class properties for error codes and messages and may be some other stuff is better than passing the status code and message by reference? This is what I think we can change even though we already programmed a lot of methods using passed parameters by reference.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform