Design Patterns Java - Facade Php

1) What have we done?

We just created "Facade" object and we use in this class intefaces of all 3 classes


public class Facade
{
    public String getDesirableObject()
    {
        ClassA a = new ClassA("something");
        ClassB b = new ClassB();
        ClassC c = new ClassC();

        a.doA();
        b.setB(a.getA());
        b.doB();
        c.doC(b);

        return c.getC();
    }
}




2) What have we achieved?

We just noticeable simplify interface for the client.
Now client doesn't have to know details of which class are used(ClassA, ClassB, ClassC) and relations between them.


public class Client
{
    public static void main(String[] args)
    {
        Facade facade = new Facade();
        String desirableObject = facade.getDesirableObject();
    }
}