This question contains a lot of different aspects. Let's start Normally db4o uses the object-identity to distinguish the different objects. So normally you don't use any ids.
However in a web application you loose the object-identity between the requests, so there's no way around using ids The internal object ids of db4o can be used for that. However this ids may change when you defragment the database. I guess that you want to have permanent ids to enable links etc.So then these ids aren't a option.
The Guid's or the db4o-UUIDs can be used as ids. However both quite are long I think the best solution is to add a field which represent the ID of the object. Then you index that field and maybe add an unique constraint to it.
This enables you also to used different kinds of ids. For example this could enable you the '/country/usa', because you use the ISO-Code as id. For simple numeric auto-ids you could use a clever id-generator I don't know the two frameworks (KandaAlpha, S#arp) you mentioned.
It sounds that the stuff still makes sense. You implement Interfaces or Attributes which add specific behavior. For example an attribute which tells the system what field is the id of the object.
The attribute ensures that this field is indexed, that the system know how to query etc In my application the indexed are added through attributes. There's an db4o-IndexedAttribute you can use. Or you could add your own.
In general I think both ways, explicitly configuring or doing the same with meta-data are ok.
This question contains a lot of different aspects. Let's start. Normally db4o uses the object-identity to distinguish the different objects.So normally you don't use any ids.
However in a web application you loose the object-identity between the requests, so there's no way around using ids. The internal object ids of db4o can be used for that. However this ids may change when you defragment the database.
I guess that you want to have permanent ids to enable links etc. So then these ids aren't a option. The Guid's or the db4o-UUIDs can be used as ids. However both quite are long.
I think the best solution is to add a field which represent the ID of the object. Then you index that field and maybe add an unique constraint to it. This enables you also to used different kinds of ids.
For example this could enable you the '/country/usa', because you use the ISO-Code as id. For simple numeric auto-ids you could use a clever id-generator. I don't know the two frameworks (KandaAlpha, S#arp) you mentioned.
It sounds that the stuff still makes sense. You implement Interfaces or Attributes which add specific behavior. For example an attribute which tells the system what field is the id of the object.
The attribute ensures that this field is indexed, that the system know how to query etc.In my application the indexed are added through attributes. There's an db4o-IndexedAttribute you can use. Or you could add your own.In general I think both ways, explicitly configuring or doing the same with meta-data are ok.
Thanks for the info, will continue experimenting. The id generator looks quite nifty. – Mac Mar 31 '10 at 17:57.
In my application the indexed are added through attributes. There's an db4o-IndexedAttribute you can use. Or you could add your own.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.