Design Patterns Java - Factory Method Php

1) What we have done?

We created abstract method "createProduct" - this is exactly the factory method from the name of this pattern
And adding to "Registry" we moved up to class "Creator"

public abstract class Creator
{
    protected Registry registry = new Registry();

    public Product getProduct()
    {
        Product product = createProduct();
        registry.addProduct(product);

        return product;
    }

    protected abstract Product createProduct();
}

public class Creator1 extends Creator
{
    @Override
    protected Product createProduct()
    {
        return new Product1();
    }
}

public class Creator2 extends Creator
{
    @Override
    protected Product createProduct()
    {
        return new Product2();
    }
}




2) What are advantages?

- there was eliminated code duplication(adding to registry)
- we can easily get "Product" in client
- we don't have to know class names in class "Creator" so we can extend application in the future easily