Design Patterns Java - Bridge Php

1) What have we done?

We created a class "ChildA"

We changed implementation of particular steps.


public class ClassA
{
    public void doA()
    {
        doStep1();
        doStep2();
        doStep3();
    }

    protected void doStep1()
    {
        System.out.println("ClassA doing step 1");
    }

    protected void doStep2()
    {
        System.out.println("ClassA doing step 2");
    }

    protected void doStep3()
    {
        System.out.println("ClassA doing step 3");
    }
}

public class ChildA extends ClassA
{
    protected void doStep1()
    {
        System.out.println("ChildA doing step 1");
    }

    protected void doStep2()
    {
        System.out.println("ChildA doing step 2");
    }

    protected void doStep3()
    {
        System.out.println("ChildA doing step 3");
    }
}




2) Is everything ok?

It seems that everything is ok but turned out that we have to add a new method into "ClassA".

Moreover let's suppose that we can't change "ClassA" (for example it is class from some library).

So we need to create another child class. Let's see how this look in step3.