Sunday, January 17, 2010

Legal Entities

Another boring database design blog by me.

I first encountered the term Legal Entity in a sci-fi book. I am pretty sure it was in one of the Ringworld series books. The term referred to any being recognized by law as having legal rights.

In our world a legal entity could be a person, a company, a corporation, a government, or any other thing recognized by law as having legal rights. Far, far too often I see databases designed to hold customer or supplier information where the customer or supplier is assumed to be a company or corporation. People and governments are often shoehorned in by being treated as a company or corporation. Of course I have also seen the opposite, with letters address to Mr. Department of Energy.

The reason for this is that most database designers design for the majority and do not take into consideration the exceptions. The exceptions are important, if only so you don't look stupid sending a voter registration form to a cat or a letter addressed to the head of household at a nuclear plant. Instead of designing a customer table that can only link to the company table design it to link to a legal entity table. The legal entity table can then indicate what type of legal entity you are dealing with and provide a link to the correct table. And if there is any possibility that your customers are going to be cats/bats/horseshoes/cars, create an entity table that contains a link to the appropriate subtype table (one of which would be legal entity).

No comments: