Inheriting PostgresNode object

Поиск
Список
Период
Сортировка
От Victor Wagner
Тема Inheriting PostgresNode object
Дата
Msg-id 20160913212153.573e378b@wagner.wagner.home
обсуждение исходный текст
Ответы Re: Inheriting PostgresNode object  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Hi hackers!

I've encountered need to extend functionality of PostgresNode class
from the TAP test framework. What I want can easily be done via perl
object inheritation. 

But documentation in the PostgresNode.pm recommends to use get_new_node
function rather than call PostgresNode constructor directly.

I see following ways to solve this problem:

1. Ignore this recommendation and write new class which calls
SUPER->new() from the constructor and call its constructor directly

2. Get the PostgresNode object from get_new_node function and bless it
into new class

3. Use delegation instead of inheritance. This would require some black
magic with AutoLoader module to avoid writing wrapper for each
PostgresNode method.

Which approach would people recommend to take?

--                                   Victor Wagner <vitus@wagner.pp.ru>



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling)
Следующее
От: Andres Freund
Дата:
Сообщение: Re: kqueue