Strong Type your entity IDs.
The Database is just an Implementation Detail A quote from Martin Fowler given during his Architecture talk stated that the Database in your application should just be an implementation detail. I agree on this wholeheartedly and find that its really not that difficult to achieve if you think about your architecture carefully. Having said that, I still see parts of the database implementation leaking out into the domain, mainly in the form of IDs....