Sunday, March 15, 2009

Global exception handler in Win Forms and Smart Client

I always wondered if it is possible to add a global exception handler for a Win Form application. This global exception handler would handle all exceptions that have not been caught in the UI forms. In web forms, we have the onError event handler in Global.asax, but I was not sure if Windows forms had a similar functionality. 
I got the answer from Rich Newman's blog here:
Another option I had tried out was using the Policy Injection Block to capture all unhandled exceptions. But the caveat here is that all objects need to be proxied, which may be tedious to do.

Monday, March 02, 2009

Priciples of SOA

Was reading "Thomas Erl's book - Priciples of Service Design" over the weekend.
It's an interesting book with a lucid language and simple to understand examples. 
Jotting down some of the design principles for SOA:
  • Services should be platform neutral and programming language neutral
  • Services should have a standard interface contract
  • Services should be loosely coupled
  • Design for coarse grained services
  • Service Abstraction - Hide information that is not required by clients. Hide underlying technology details. Promotes loose coupling.
  • Service Reusability - Position services as enterprise resources with agnostic functional context; i.e. the service can be used in other functional scenarios too. Always design the service in such a way, that it can be used beyond its original context.
  • Service Autonomy - Services need to have a high degree of control over their underlying runtime execution environment. The higher up a service is in a typical composition hierarchy, the less autonomy it tends to have due to dependencies on other composed services.
  • Service Statelesness - defer or delegate state to databases, rather than in memory.
  • Service Discovery - services can be discoved using standards such as UDDI.