Suppose I have a Shape interface, implemented by Square, Triangle, Circle, etc.
I'd like to construct those shapes in 2 different ways:
- first, by passing an enum that tells it what shape to give me back
- secondly, by giving me a random shape back
Both ways of creating a Shape would share some logic, since I'm interesting in getting shapes that don't overlap on an XOY coordinate system.
Would it be better to get make a single Factory with 2 methods or 2 Factories with a method each?