On Fri, Aug 21, 2009 at 6:58 PM, Alan Gauld<alan.ga...@btinternet.com> wrote: > "Serdar Tumgoren" <zstumgo...@gmail.com> wrote > >> I'm trying to create a data-retriever class that executes certain SQL >> statements based on the name of a calling class > > This is a really bad "smell" from an OO design point of view. > >> can group a bunch of SQL statements in one place; they're currently >> scattered all over the program and it's getting unwieldy). > > Normally in an OO program the SQL for each class is in the methods for that > class. That way any changes to the class canbe easily reflected in the > related SQL.
But if all the classes need nearly the same SQL, it may make sense to abstract that out to a common location.That is what Serdar is trying to do. Duplication is also a bad smell. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor