Chapter 3. Understanding the Scala Ecosystem

Learning a new language also means getting acquainted with a new ecosystem of frameworks and tools. The good news is, in Scala, we can largely inherit the very rich and mature set of available tools and libraries from Java. In this chapter, we are going to cover the major novelties and additions to the existing ecosystem that we, as Java developers, are already familiar with.

In this chapter, we will cover the following topics:

  • Code editing environments—also known as IDEs
  • SBT—a tool specific to Scala to build, test, and execute code
  • Utilities as plugins to SBT to integrate with the Java ecosystem
  • Scala Worksheets—a novel approach to interactive programming
  • Working with HTTP and interacting with external web-based services, including the introduction of "for comprehensions"—a useful Scala construct
  • Typesafe Activator—a convenient tool to bootstrap projects quickly
  • Using Scala for scripting

Inheriting Java Integrated Development Environments (IDEs)

Scala is supported on all the three major Java IDEs: Eclipse-based (including all the different versions of Eclipse, Typesafe's own bundled version known as Scala IDE as well as more commercial IDEs such as SpringSourceSTS), IntelliJ IDEA, and NetBeans. This means that you can just keep working as you used to with Java, for instance, running Scala JUnit tests inside the IDE, directly debugging or remote debugging. The extended Scala support on all of these platforms will provide you with the very useful autocompletion feature and instant feedback on the various types that are inferred by the compiler. In Chapter 2, Code Integration, we used NetBeans mostly because it had a convenient, small, and ready-to-use database and embedded tools to reverse engineer this database into a RESTful API in Java. As the usage of Eclipse targets a larger audience and is also the reference IDE that Typesafe provides support to, we are going to use it for the following chapters as our main development environment.

From the scala-ide.org website, you can download and install the Scala IDE for Eclipse either as the bundled version that supports Scala or the Scala plugin through the use of update sites (as you would do in Java for installing any other Eclipse plugin into an existing environment). All instructions to install either the bundled or the plugin versions are very well explained on this site, so we won't spend much time here repeating this process. Instructions to install IDEA and NetBeans are available from http://www.jetbrains.com/ and http://www.netbeans.org/, respectively.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset