__getattr__ Considered Harmful
Monday, August 4th, 2008I just refactored a number of internal aspects of Pygr’s object-relational model, to make use of a new pattern I’m calling “subclass binding”, which I’ll try to explain a bit in this post. First I’ll try to explain the problem from the viewpoint of a Python programmer.
Object-relational design makes modularity even more difficult than usual. It illustrates a general problem: when you try to combine two different behaviors (e.g. a local Python object and a back-end database) into one object, all sorts of confusion can ensue.