Open mpmenne opened 5 years ago
Thanks Mike!
I went ahead and implemented the factory to handle instantiation and Pyramid objects. Thanks for the reminder on immutable vs mutable objects as well, memory wastes end up adding up real quick, especially on mobile devices.
Great job using StringBuilder for your Pyramid! I like how you initialized it in the constructor.
One suggestion for your
Pyramid
class. Break it out into two separate classes. Create aPyramid
object that you can pass around and create aPyramidFactory
that allows you to generate pyramids. Also, consider passing in the size of the pyramid to the constructor. Immutable objects are always preferred to mutable objects. If you ever need a new pyramid, you can just generate a new one without changing your existing pyramid.