dog

A Scala Factory Pattern example

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 DogFactory and CatFactory that extend an AnimalFactory trait:

Good design: Quantity leads to quality (and iteration speed is vital)

When I saw this tweet this morning:

[DOG MAGICIAN] think of a color, any color ... is it ... gray?

[OTHER DOG] oh my GOD

I knew that I loved the joke, but I didn’t like the presentation. I wanted to put the joke on Facebook, but I know that people like images more than they like text, so I made a second cup of coffee and began putting the text on an image.

Rocky and a bone

While I’m sharing photos of Siberian Huskies I’ve known and loved, here’s one of Rocky working on a bone. My wife originally found him stuck in a cinder block in Virginia when he was probably about 18” long, and he became the first husky we’d know. He became famous for destroying furniture, howling, and running around saying words like “Oprah” and “Geraldo.”

IBM to buy Red Hat; Dog pretends to be a stray to get food outside McDonald’s alvin October 29, 2018 - 7:51am

The best stories of the weekend are IBM buying Red Hat, and a dog that pretends to be a stray to get food outside a McDonald’s. Oh, and the Red Sox beat the Dodgers to win the World Series last night.