Re: [GENERAL] Retrieval of OO objects. - Mailing list pgsql-general

From Chris Bitmead
Subject Re: [GENERAL] Retrieval of OO objects.
Date
Msg-id 3717D72B.688C6025@bigfoot.com
Whole thread Raw
In response to Re: [GENERAL] Retrieval of OO objects.  ("Oliver Elphick" <olly@lfix.co.uk>)
Responses Re: [GENERAL] Retrieval of OO objects.  ("Oliver Elphick" <olly@lfix.co.uk>)
List pgsql-general
Oliver Elphick wrote:

> If you need features of bbb and ccc you must use those classes, not their
> ancestor.
>
> Class bbb knows about a and b and class ccc knows about a and c, but
> aaa doesn't know about b and c because they are not defined in aaa.
>
> `Vertebrate' is a descendant class of `animal'.  `Vertebrate' has a feature
> `bones', but `animal' doesn't, because the majority of animals don't have
> bones at all.
>
> This is how inheritance works in the Eiffel language, at least.

I guess the point is if you had an Eiffel collection of animals, two
Invertebrates and two vertibrates, and did a save to disk. When you
loaded the collection back in from disk you wouldn't expect to get back
4 animals, whose status as vertibrates or invertibrates is no longer
known.

In a real object database, you could say "Get all the animals", and they
would come back appropriately - some as vertibrates, some as
invertibrates. Since they come back properly we can call methods on
different types of animals and they will behave differently as
appropriate.


--
Chris Bitmead
http://www.bigfoot.com/~chris.bitmead
mailto:chris.bitmead@bigfoot.com

pgsql-general by date:

Previous
From: "Oliver Elphick"
Date:
Subject: Re: [GENERAL] Retrieval of OO objects.
Next
From: The Hermit Hacker
Date:
Subject: Re: [GENERAL] The WWW of PostgreSQL