From: John B. <jb...@dr...> - 2003-11-10 21:04:54
|
On Monday 10 November 2003 20:56, Ian Bicking wrote: > doesn't involve terms (or even concepts) like "implicit" or "folding", > then maybe I'll feel more enthusiastic. I'm trying to avoid magic to > the degree possible, which is where my reluctance comes from. I didn't really find a real reason in there ;-) Superset mapping makes obvious logical sense when you present the model to an OO programmer. If you are talking objects, you map with supersets. Some of my code to cope with the above example is absolutely sick, but I have no choice. However SQLObject is free, so I'm not going to worry too much - I'll just implement it for you one day :-) Consider other cases where you have a collection of objects that you want to map back to one parent, regardless if you are actually mapping to a child. You might have a "Property", and you might want any object to have a collection of Properties. In OO, you'd define something like: class Item (SQLObject): properties = MultipleJoin("Property") name = StringCol() class Bill (Item): value = FloatCol() .. and many other extension of Item and every extension has access to the list of Properties. We define OO structures to reduce our code and reuse objects, and mappings to tables should work in exactly the same way. After all, why should the OO developer have to worry about tables? The OO developer wants to store something, he/she doesn't want to worry about how it's stored... I'll get on with my work now :) John -- John Baker, (m) 07736393822 http://rant.pointful.info |