Re: OOP real life example (was Re: Why is MySQL more

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Greg Copeland <greg(at)CopelandConsulting(dot)Net>
Cc: Hannu Krosing <hannu(at)tm(dot)ee>, Curt Sampson <cjs(at)cynic(dot)net>, Don Baccus <dhogaza(at)pacifier(dot)com>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: OOP real life example (was Re: Why is MySQL more
Date: 2002-08-12 15:39:42
Message-ID: 1029166783.1353.117.camel@linda
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 2002-08-12 at 15:00, Greg Copeland wrote:
...
> Look a little deeper here. In other OO implementations, I can define a
> class (say class a) which has no instances (abstract base class).
> Furthermore, I can take this case and use it for building blocks
> (assuming multiple inheritance is allowed in this world) by combining
> with other classes (z inherits from a, b, c; whereby classes a, b, c
> still do not have an actual instance). I can create an instance of my
> newly inherited class (z).
>
> Seems to me that there is some distinction between types (classes) and
> and type instances (instance of a specific class) as it pertains to it's
> usability.
>
> How exactly would you create an abstract base class for table type?

CREATE TABLE abstract_base (
cols ...,
CONSTRAINT "No data allowed in table abstract_base!" CHECK (1 = 0)
)

This assumes that the constraint is not inherited or can be removed in
child tables.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"And he spake a parable unto them to this end, that men
ought always to pray, and not to faint."
Luke 18:1

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2002-08-12 15:44:24 Re: [HACKERS] Linux Largefile Support In Postgresql RPMS
Previous Message Andrew Sullivan 2002-08-12 15:30:36 Re: [HACKERS] Linux Largefile Support In Postgresql RPMS