Re: [GENERAL] Retrieval of OO objects.
| От | Chris Bitmead |
|---|---|
| Тема | Re: [GENERAL] Retrieval of OO objects. |
| Дата | |
| Msg-id | 3717D72B.688C6025@bigfoot.com обсуждение исходный текст |
| Ответ на | Re: [GENERAL] Retrieval of OO objects. ("Oliver Elphick" <olly@lfix.co.uk>) |
| Ответы |
Re: [GENERAL] Retrieval of OO objects.
|
| Список | 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 по дате отправления: