From: Gerald B. <ger...@gm...> - 2009-07-12 23:07:27
|
No that's not it. The iter_... functions I added to proxybase are generic and broadly applicable. The filter.py method needs to override it, that's all. The benefit of having generic methods in proxybase that apply to most situations outweighs (far outweighs, as I see it) the risk of missing a custom implementation and, as shown by this discussion, is easy to correct. I also believe that the situation in which this occurred (adding iterators across the codebase) is atypical and would be a highly-unlikely issue when building a new subclass of proxybase. The alternative -- implementing identical methods in each subclass -- is tedious at best (over time proxybase may have dozens of children) and goes against good object-oriented programming principles. On Sun, Jul 12, 2009 at 4:32 PM, Brian Matherly<br...@gr...> wrote: > >> The problem was that I neglected to >> implement iter_family_handles and >> tow other methods in filter.py so that the generic methods >> in >> proxybase were being used. > > This is exactly the kind of problem I was describing when I suggested that proxybase methods should be pure virtual. If iter_family_handles raised NotImplemented, this bug would have been immediately obvious the first time you tried to use filter.py. > > I hate to say I told you so ... but I did :) > > ~Brian > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel > -- Gerald Britton |