title: Python - how to implement Bridge (or Adapter) design pattern?
body: <p>I'm struggling with implementing the Bridge design pattern (or an alternative such as Adapter) in Python</p>
  
  <p>I want to be able to write code like this to dump database schemas based on a supplied URL:</p>
  
  <pre><code>urls = ['sqlite://c:\\temp\\test.db', 'oracle://user:password@tns_name'];
  for url in urls:
      db = Database(url);
      schema = db.schema()
  </code></pre>
  
  <p>I've got classes defined as</p>
  
  <pre><code>class Database():
      def __init__(self, url):
          self.db_type = string.split(self.url, "://")[0]
  
  class Oracle():
      def schema(self):
          # Code to return Oracle schema
  
  class SQLite():
      def schema(self):
          # Code to return SQLite schema
  </code></pre>
  
  <p>How can I "glue" these 3 classes together so I can get the first code block to execute correctly?  I've Googled around, but must be having a thick day as it's just not coming together in my mind...</p>
  
  <p>Thanks in advance</p>