While playing with db4o a while back I kept getting smacked with how to structure my data. Primary Key’s are a database thing, and they are a hard habit to break. How do we achieve the same level of identity in the OODB world? This is one of those small steps that will help you appreciate the baggage that comes with trying to get objects into an RDBMS. After, some thought its not that they DON’T have ‘primary keys’ its that not EVERYTHING does. By PK I mean the esoteric academic sense, that in one row of data every object is uniquely identifiable. Sure, under the covers db4o has a PK that you can use, but its not advised so, unless you are working with a stateless application. Every top level object (aggregate root?) will have some way to be identified, but its children objects might only be identifiable through the top level object. In an RDBMS, you can jump straight to any data item because everything is identifiable in isolation. In the OODB world I get the picture that this is not true, that you find the root object and traverse it down to the object you are interested in. Hey, kinda like objects. Another interesting way to think about data.
Posted on Sat, 04 Jun 2011 16:52:53 +0000 at http://feedproxy.google.com/~r/CodeBetter/~3/5ALjpIwA90A/
Comments: http://codebetter.com/drusellers/2011/06/04/db4os-no-primary-keys/#comments
Posted on Sat, 04 Jun 2011 16:52:53 +0000 at http://feedproxy.google.com/~r/CodeBetter/~3/5ALjpIwA90A/
Comments: http://codebetter.com/drusellers/2011/06/04/db4os-no-primary-keys/#comments