19.4. Summary

This chapter discussed some simple but effective exception-handling guidelines and resilience patterns that can be used to offer more robustness in the application and overall solution.

The following are the key points to take away from this chapter:

  • Manage configuration changes appropriately. Ensure that configuration values are fully documented, especially when they relate to other values and settings, such as throttles.

  • Understand the browser behavior. You should fully understand the browser's navigation controls and what happens "behind the scenes", especially during postback and other browser functions such as forward, back and refresh.

  • Validate user inputs and encode them. You should always validate user input and where necessary encode the values to avoid malicious attacks.

  • Protect the system against URL hacking. The application should not allow users to perform actions that they are not authorized to do.

  • Consider implementing a token-synchronization pattern. The token synchronization pattern helps to ensure that all operations and transactions return to a "known state."

  • Don't leave exception handling to the last minute. Have an exception handling strategy up front.

  • Handle exceptions where you can. You need to consider all the exceptions that could occur in a method and handle each of them appropriately.

  • Add value where you can't actually handle an exception. It is important for incident investigation that you record as much information about the exception and the ...

Get Design – Build – Run: Applied Practices and Principles for Production-Ready Software Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.