Participants

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5087fa7c-67c4-42a7-abc8-b03e9f41a173/Untitled.png

IAutoFactory autoFactory = new BmwFactory();
IAuto auto = autoFactory.GetInstance();
    
interface IAuto
{
    string GetName();
}

class Bmw : IAuto
{
    public string GetName() => "Bmw";
}

interface IAutoFactory
{
    IAuto GetInstance();
}

class BmwFactory : IAutoFactory
{
    public IAuto GetInstance() => new Bmw();
}

Rules of Thumb