Welcome to Habanero Land!   Register  |  Login
You are here:   Blogs
  So, why do you need to register to download Habanero and access the additional materials? 
The success of any open source project is based on the community built around it. So go ahead, register / login and get involved!
Blog Roll
 
Categories
 
Search Blog
 
 
Habanero Cloud
 
Habanero Archive
 
Recent Blog Posts
 
 
By brettright brettright on Wednesday, May 19, 2010 10:54 AM

The Concept of Object Persistance and Object identity have been around for as long as I've been programming (14 years) and probably longer. Unfortunately most systems and most developers in the Microsoft world have been developed using a database centric approach. The flow to Domain Driven Designs has thankfully finally started to flow strong and hard and I find myself spending less time having to argue the merits of DDD with other developers.

However when Consulting I am regularly faced with Database Designs that use AutoIncrementing Fields or mutable properties or even worse composite mutable properties as the Primary Key in the Database.

Example of AutoIncrementing Primary Key. Person has a PersonID : int as the Primary Key and the PersonID is set by the Database when the Person is first inserted into the DB.

Example of a Composite mutable property as a Primary Key. Person has FirstName: string and Surname : string as the Primary Key in the Database. If these are mutable then some sort of Cascade Update is set so as to ensure that all other related tables FK's are maintained as valid.

Now 12 years ago I used to see a lot more of this type of Database Design I still see quite a lot of this today. The reasons are numerous and sometimes inescapable e.g. I am developing with a legacy database, I have an .xxx.. DBA who is stuck in the 1960's. The company has programming standards that were written in the 80's etc.

In this blog I will discuss why I prefer and rcommend using Guids whenever possible or an application generated Integer (when the DBA has an unjustified fear of GUID's) and also how

This website is best viewed in Internet Explorer 7 & 8; Firefox; Opera; & Safari.

Get Habanero at SourceForge.net. Fast, secure and Free Open Source software downloads