"sasha" ...
>
> > и почему это instead of должен быть только один... а может я хочу их два?
>
> Возьмём ваш любимый паскаль и смоделируем:
>
> class Table
> {
>    procedure Insert; virtual;
>    begin
>    end
> }

    Пример (да я вообще аналогия) не корректный :

class Table
{
public:
    void Insert()
    {
       fireBeforeTriggers();
       doInsertIntoTable();
       fireAfterTriggers();
    }

protected:

    virtual doInsertIntoTable()
    {
        ...
    }
};


class View : Table
{
protected:
    virtual doInsertIntoTable()
    {
        if (!haveUserTriggers) // вот эту проверку добавили в ФБ
            doInsertIntoView()
    }

    void doInsertIntoView()
    {
        if (updatable)
        {
            bla-bla-bla
        }
        else
            throw new danunah();
    }
};


Ответить