/PizzaPosOopStyle

An OOP version of the Pizza POS system

Primary LanguageScala

OOP Version of the Pizza POS System

This project contains the source code for the OOP version of the “Domain Modeling” lessons in my book, Learning Functional Programming in Scala.

There are two primary directories in this project:

  • v1_true_oop contains the OOP code you’d write if you wanted to stick to the OOP model, and use private fields with getter and setter methods
  • v2_simple_oop contains simpler versions of the OOP code that makes the class fields public

The common package contains the traits that are common to both of those code versions, including the Topping, CrustSize, and CrustType traits.

This project isn’t intended to show a perfect OOP design; it’s just intended to provide a quick OOP review and a means to show a contrast with FP styles.

Alvin Alexander
http://alvinalexander.com