Fun with Functions, and Never Having to Close That JDBC Connection

  • David Pollak


We saw Scala functions in action in the last chapter. Passing functions to map and filter allowed us to write code that was more readable and understandable. The looping was done in the method, allowing our application code to be cleaner and easier to maintain. In this chapter, we’ll explore functions in more depth and learn about how functions allow us to encapsulate business logic and separate it from the imperative flow of control statements. We’ll write our own control structures, including looping and automatic JDBC connection closers that will lead to cleaner, better code.


Control Structure Code Block Type Parameter Java Code Imperative Flow 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© David Pollak 2009

Authors and Affiliations

  • David Pollak

There are no affiliations available

Personalised recommendations