Inheriting PostgresNode object

Поиск
Список
Период
Сортировка
Искать
От
Victor Wagner
Тема
Inheriting PostgresNode object
Дата
Msg-id
20160913212153.573e378b@wagner.wagner.home
Список
Дерево обсуждения
Inheriting PostgresNode object Victor Wagner <vitus@wagner.pp.ru>
Re: Inheriting PostgresNode object Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Inheriting PostgresNode object Tom Lane <tgl@sss.pgh.pa.us>
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 


В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Andres Freund
Дата:
Сообщение: Re: kqueue
FAQ