lundi 19 avril 2021

Is this example a factory design pattern or an abstract factory

I am considering which design pattern the code below is and I am trying to distinguish between a factory pattern or an abstract factory pattern.


public abstract class SomeObject
    {
    }

    public class ConcreteSomeObject : SomeObject
    {
    }

    public abstract class AnotherObject
    {
        public abstract SomeObject Create();
    }

    public class ConcreteAnotherObject : AnotherObject
    {
        public override SomeObject Create()
        {
            return new ConcreteSomeObject();
        }
    }

Aucun commentaire:

Enregistrer un commentaire