This chapter covers
- Understanding why Scala is one of the better languages for domain modeling
- Understanding the benefits of domain modeling using a statically typed language
- Combining the OO and FP power of Scala to achieve modular and pure models
Now that you’re familiar with the basic concepts of functional and reactive domain modeling, how will you go about implementing such a model? And when you think about implementation, you must think about which language to use. Many languages provide enough power to implement expressive domain models. This book uses Scala, an object-functional language that’s statically typed, runs on the Java virtual machine (JVM), and offers excellent interoperability with Java.
But you may wonder, why Scala? What special features does Scala offer that make it an attractive proposition for domain model implementation? You’ll learn some of those features in this chapter and see how they help in specific aspects of building the model. Scala has both object-oriented (OO) and functional capabilities, which turn out to be a powerful combination in implementing and organizing domain models. You’ll use the functional power of Scala to implement immutable data and domain behaviors, and you’ll use its OO capabilities to modularize your domain models.