Created
April 7, 2011 17:14
-
-
Save danesparza/908231 to your computer and use it in GitHub Desktop.
Bad usage of status codes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of poor design... | |
// Note the lack of any useful constraints on the 'status' member. You can type anything there! | |
// What happens if you're trying to pass this across a web service boundary to somebody consuming | |
// your service and you made a typo in one of your status responses. Tracking down this bug is hard. | |
// Pandas are very sad. | |
public class WsResponse | |
{ | |
public string Status; | |
public string StatusDescription; | |
public WsResponse() {} | |
public WsResponse(string status, string statusDescription) | |
{ | |
Status = status; | |
StatusDescription = statusDescription; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment