Re: class super method



On Apr 1, 2008, at 6:10 PM, Steve Holden wrote:

Ed is a good enough designer to avoid the corner cases. Strangely enough
the one place where I have ended up making significant use of super()
was in providing mixins for wxPython interface classes!

Thanks much for the compliment. Yes, wrapping the disparate and confusing wxPython classes to have a consistent interface is where we also make the most use of super(), but our database wrappers also provide consistent functionality to all the dbapi cursors, no matter what the backend database may be.

The only reason this works is that we are working with a single known class interface; we control all our own mixin class designs. With the wxPython stuff, each class has a well-defined set of methods and method signatures, and with the database stuff, we only mixin with the dbapi-standard methods, and avoid hooking into module-specific enhancements.

My point in these postings is that working with multiple inheritance is fraught with potential pitfalls; super() doesn't create these pitfalls, although it can make it easier to fall into them. If you try to create a PotBelliedElephant class by using MI with a PotBelliedPig class and an Elephant class, well, you *should* crash and burn, whether you use super() or not.

http://en.wikipedia.org/wiki/An_Elephant_Makes_Love_to_a_Pig

-- Ed Leafe



.



Relevant Pages

  • Re: MS Access with Linked tables Security Issue
    ... connect to SQL Server database with one Super ID that has all the super ... Dim dbs As Database, rs As Recordset, tdfAccess As TableDef ... Set dbsODBC = OpenDatabase ...
    (microsoft.public.access.forms)
  • Re: Mail Merge
    ... You can find my "super easy word" merge here: ... Often if that query has any functions, ... database, then again problems arise. ...
    (comp.databases.ms-access)
  • Re: Where do I start
    ... I could be misstating this is so someone please correct me. ... (My super cool graphical page creator is gvim. ... The problem is that dreamweaver generates static pages. ... If all you want to show the contents of a database table on a page then sounds like what you want is a graphical interface to the database, ...
    (php.general)
  • Sloooooooooowwwwwww Intel Duo Macbook
    ... I have just shelled out on a new Mac and for some reason it is super ... I thought these machines were supposed to be light speed. ... Verify Preference Files ... Update Locate Database ...
    (comp.sys.mac.system)
  • Re: Ist LateBinding schlecht?
    ... Das ist doch super;) Dann könnte ich es deaktivieren und bequem ... Late-Binding betreiben. ... Ich definiere ein Interface, in dem nur eine Funktion definiert ist, ... Vorteil, dass wenn ich die Hauptapplikation um eine Kleinigkeit erweitere, ...
    (microsoft.public.de.german.entwickler.dotnet.framework)