Here’s a small example of how to create a Factory Pattern in Scala. In the Scala Cookbook I created what some people might call a simple factory and/or static factory, so the following code is a much better implementation of a true OOP Factory Pattern.
The factory classes
I don’t have too much time to explain the code today, but here are the classes that make up the factory, including a set of “animal” classes along with a
CatFactory that extend an