This pseudocode depicts the design pattern. Is it the factory method or prototype?
interface Shape is
method draw()
class Square implements Shape is
method draw() is
print "Square"
class Circle implements Shape is
method draw() is
print "Circle"
class ShapesFactory is
method shapeType(String shape) is
if (shape == square) then
return new Square()
else if (shape == circle) then
return new Circle()
else
print "Error"
class App is
method drawShape()
ShapesFactory shapeFactory = new ShapesFactory()
shape1 = shapeFactory.shapeType(square)
shape1.draw()
shape2 = shapeFactory.shapeType(circle)
shape2.draw()