S h o r t S t o r i e s

// Tales from software development

Archive for February 2011

.NET Remoting: exceptions are not marshalled because of the value of CustomErrors.

leave a comment »

Over the past couple of years I’ve had to write one or two .NET Remoting applications each year. It seems that gives me just long enough between each project to forget some of the basics and have to track down and fix the unexpected behaviour I identify in testing. Having just completed another .NET Remoting project I can’t believe that yet again I forgot to set CustomErrors off but I did.

Part of the problem is that this issue never shows up when your running the remoting server locally or when tests run successfully and exceptions are not throw. It’s only apparent when an exception is thrown on a remote server and the default value for CustomErrors, RemoteOnly, causes the error to be filtered resulting in the exception not being marshalled to the client.

The code that creates the remoting server by calling the RegisterWellKnownServiceType() method needs to set the CustomErrorsMode property:

RemotingConfiguration.CustomErrorsMode = CustomErrorsModes.Off;

 Hopefully, I’ll remember this in the next .NET Remoting project.

Written by Sea Monkey

February 3, 2011 at 8:00 pm

Posted in Debugging, Development

Tagged with ,

Forename, first name, full name…

with 2 comments

You’d think that by now there’d be a standard way of storing and representing people’s names in computer systems but it doesn’t seem so.

My company’s clinical data system stores patient names according to the specification provided by the customer. Some customers are happy with simply first name and last name while others want title, first name, middle names or initials, last name, and name suffix. Some customers require the name components to be labelled First name and Last name while others insist on Forename and Surname.

While recently working on a project to implement a generic ODBC interface to our software I looked at the specifications for several different customer’s data systems and found what seemed to be every permutation of ways to store patient names possible.

I searched the internet thinking that there must be a standard for the representation of names. I didn’t find one but I did come across the following discussion that shows that my concerns are shared by many others:

http://discuss.joelonsoftware.com/default.asp?design.4.551889.41

I don’t know whether to be amused or worried by the suggestions that a single field, FullName, is sufficient and that the software can infer forename and surname if necessary. At the very least this is a naive suggestion that suggests the person who made it has little experience of real world commercial software development.

After reading the whole of this discussion I came to the conclusion that, for my purposes at least, I ought to adopt the following approach:

Title – Optional
FirstName – Required
MiddleName – Required
LastName – Required
NameSuffix – Optional

The terminology (e.g. first name rather than forename) should be used consistently internally. If our customers wish to label these fields differently to this, e.g. on web pages or application screens, that’s OK.

Written by Sea Monkey

February 1, 2011 at 8:00 pm

Posted in Development

Tagged with