Exemplo n.º 1
0
    public static void Main(string[] args)
    {
        // need a prototype manager
        PrototypeManager manager = new PrototypeManager();
        // prototype manager registers a few prototype
        manager.loadCache();
        // prototype manager can now be used as factory object
        Shape clonedShape1 = manager.GetShape("1");
        clonedShape1.Draw();

        Shape clonedShape2 = manager.GetShape("2");
        clonedShape2.Draw();

        Shape clonedShape3 = manager.GetShape("3");
        clonedShape3.Draw();
    }