Friday, February 25, 2005

I've been experimenting with the UnsafeAuthenticatedConnectionSharing setting in order to speed up the WebService call time. I must say that the results are quite satisfying for the time being. Going from several seconds to sub-second response time. In our solution the service gets called about 60.000 times in a row so performance is a key factor in the process. Obviously there are some downsides to this property. Make sure you carefully study the security aspect before implementing this. In our case it is an application that uses just one user account and runs on a server without user intervention.
Code profiling in .NET, sweet performance :)

Check out this article about various tools. I also tried the JetBrain NetProf which imho wasn't too bad either. If you don't know the people from JetBrain check out ReSharper, that tool seriously rocks!

Thursday, February 24, 2005

Finally got around to some C#'ing :-)
In order to generate the massive amount of reports I'm writing a multi-process, multi-threaded report generator.

Experimenting with the Enterprise Library (Patterns & Practices) which has some very nice features. The configuration tool is very handy and lets you visually configure the framework properties. Creating an Exception handler with logging is a matter of minutes.

To use it just create a reference to the DLL. Policies can be defined per exception and how to handle it.

int a = 10;
int b = 0;
int c = a / b;

catch(Exception ex)
bool rethrow = ExceptionPolicy.HandleException(ex, "General Policy");
if (rethrow)
throw ex;

The policy provides a couple of handlers:
  • Custom handler: you create your own handler class
  • Logging handler: logging to text file, eventlog, ...
  • Replace handler: replace an exception with a new one, for example to remove sensitive data from exception information
  • Wrap handler: to wrap an exception in another exception (InnerException), for example to pass exceptions from your data layer to your business layer which then handles the exception

I hope more posts will follow about the Enterprise Library!