2

A (too) short introduction to Scala

 3 years ago
source link: http://blog.rcard.in/programming/scala/2015/05/21/a-too-short-introduction-to-scala.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

A (too) short introduction to Scala

May 21, 2015

scala design pattern presentation

I recently had an introductory talk on the Scala programming language. The audience of the seminar was mainly composed of students of the bachelor-level informatics curriculum at the University of Padova. These students had just learned to program in Java, to use UML notation and design patterns. So I thought: “Why don’t I propose to my students something alternative to Java. A language that interiorizes the best practices of programming of the last fifteen years. So, Why don’t I have a talk about Scala?

And this is the story about how this introductory talk about Scala was born.

So, the aim of the talk was not to be a comprehensive presentation of the Scala programming language. The aim was to introduce the Scala language, putting a stress on the features that made it one of the heirs to the throne of programming.

In particular, the following concepts in the talks are presented:

  • A brief history of the language
  • Main syntax features
  • Object oriented Scala (Classes, Objects, Abstract classes and Traits, Case classes and pattern matching, Generics, Implicits, Option[A], Tuple)
  • Functional Scala (First class functions, Lambdas, Recursion, Currying, Call by name/value)

Using these concepts, I showed to my students how the language allows to implement natively some design pattern, such as:

  • Singleton
  • Factory method
  • Null object
  • Decorator (using mixins)
  • Abstract factory
  • Value object
  • Adapter
  • Strategy
  • Command
  • Template method

Let’s say that if you have a OO background and if you want to start to learn the Scala language, this talk could be a good starting point. But, if you want to go a little deeper, I suggest you this book:

Scala for the impatient, Cay Horstmann, Addison-Wesley 2012

Share the :  

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK