Disclaimer: I am not affiliated in any form with Typesafe.
In this section, we discuss how Scala can enhance the pedagogy in certain foundational and applied advanced courses. Given that the majority of students coming out of our undergraduate and graduate programs find jobs in local and global industry, we place considerable emphasis on professional practice.
To this end, we draw on several (local and global) resources:
We attempt to strike a balance among solid foundational knowledge, state-of-the-art technology, and job market demands. In particular, we have adopted the following rule for our advanced courses and research projects: new code in Java (the language, as opposed to the platform).
We also strive to choose technologies that scale properly. Here, the typical startup story goes like this: Implement in RoR, oops, it doesn’t scale, then redo in guess what language? There are an increasing number of good language and platform choices here, and in our experience, Scala is one of them.
The job market is also increasingly interested in Scala. Here [http://jobs.cs.luc.edu/post/41214148685/telecommuting-internships-and-full-time-positions-at] is an interesting local internship ad.
Starting in 2010, we have been incorporating Scala into several of these courses, taught mostly by Konstantin and experienced professionals serving as adjuncts.
In our experience, Scala can help with the pedagogy of advanced applied courses in multiple ways:
In the remainder of this section, we will give an overview of web application and web service development in Scala and contrast the experience with the corresponding Java-based techniques.
The predominant web application frameworks targeting Scala are Lift [http://liftweb.net] and Play! [http://playframework.com]. Typesafe has adopted the latter as part of its official stack [http://typesafe.com/stack], and we had actually started to use Play! in our course before Typesafe’s decision was known.
The primary concerns in the development of web application for human users—as opposed to a web service for programmatic consumption—are
When using a Java-based stack, we typically address these concerns with a stack tied together by a dependency-injection framework such as Spring and an object-relational mapper (ORM) such as Hibernate, along with a MVC framework for the upper layers.
When using a Scala-based stack, we an express an equivalent architecture much more concisely and using language mechanisms instead of requiring a DI framework.
As opposed to the Simple Object Access Protocol (SOAP), we will focus on representational state transfer (REST), which has emerged as the preferred approach of the broader agile community.
The implementing-rest community has put together a helpful language matrix [https://code.google.com/p/implementing-rest/wiki/ByLanguage] of REST libraries, toolkits, and frameworks. Typesafe’s stack does not yet include strong support for RESTful web services in the sense of a high-level DSL for request routing, which is where some of the choices in the language matrix come into the picture.
We have picked spray [http://spray.io] not only because the author is from Konstantin’s home town but also because it is:
Scala and Spray are supported by Heroku [https://devcenter.heroku.com/articles/scala] and several other newer APaaS cloud providers. Deploying a service to the cloud requires a simple Git commit; this makes it possible to achieve continuous delivery.