Read e-book online Beginning Scala PDF

By Vishal Layka, David Pollak

ISBN-10: 1484202325

ISBN-13: 9781484202326

ISBN-10: 1484202333

ISBN-13: 9781484202333

Beginning Scala, moment Edition takes a down-to-earth method of instructing Scala that leads you thru uncomplicated examples that may be mixed to construct complicated, scalable platforms and applications.

This publication introduces you to the Scala programming language, its object-oriented and practical programming features, after which publications you thru Scala constructs and libraries that let you gather small parts into high-performance, scalable structures. you'll study why Scala is judiciously used for serious company purposes by way of top businesses equivalent to Twitter, LinkedIn, Foursquare, the mother or father, Morgan Stanley, credits Suisse, UBS, and HSBC.

Scala is a multi-paradigm programming language that mixes either practical and object-oriented gains. in addition, this hugely scalable language lends itself good to construction cloud-based/deliverable software program as a carrier (SaaS) on-line applications.

What you’ll learn

• comprehend the fundamental syntax and mechanisms for writing Scala programs

• examine the object-oriented positive aspects of Scala

• Use Scala's sensible programming positive factors to outline and deal with concurrency

• construct parsers utilizing Scala’s library of parser combinators

• Create and control XML content material utilizing Scala

• make the most of Scala's common annotations or even create your own

• combine and reuse an present Java codebase

• construct initiatives that include either Scala and Java code and dependencies

• Use Scala libraries and Scala internet frameworks equivalent to Play 2 to construct internet functions with Scala

Who this e-book is for

This e-book is for all programming fanatics and for Java builders trying to lessen boilerplate code, enhance group functionality, enhance inter-team dynamics, and construct extra scalable and powerful structures. additionally, this publication will entice Java builders seeking to do cloud-based improvement. finally, Ruby, Python, Groovy and different programmers trying to find the next functionality and a much better language will gain.

Table of Contents

1 : Getting began with Scala

2 : fundamentals of Scala

3 : OOP in Scala

4: sensible programming in Scala

5: trend matching

6: Scala Collections

7: features

8: forms and Implicits

9: Scala and Java Interoperability

10: SBT

11: development internet purposes with Scala

12: DSL

13: Scala most sensible practices

Show description

Read or Download Beginning Scala PDF

Similar object-oriented software design books

Download e-book for iPad: Designing Microsoft ASP.NET applications by J. Reilly Douglas

Offers the most recent instruments and techniques-and wealthy, reusable code samples-that builders have to construct high-performance net options with ASP. web.

New PDF release: Perl Power-: A JumpStart Guide to Programming with Perl 5

The internet is booming, the vast majority of CGI functions are coded in Perl. for that reason, there's a large variety of novices and intermediate builders eager to get to understand Perl typically and net purposes with Perl specifically. research Perl fundamentals and wake up to hurry with net and item orientated programming with only one publication.

Learning Vaadin 7, Second Edition by Nicolas Frankel PDF

This booklet a pragmatic consultant to help you in developing top-notch net functions with the most effective frameworks in accordance with Java. you'll find out about the basic ideas which are the cornerstones of the framework. additionally, this booklet will provide help to combine Vaadin with renowned frameworks and the way to run it on most sensible of inner in addition to externalized infrastructures.

Extra resources for Beginning Scala

Sample text

Function literals allow you to have an expression of a function type that you can write in a short format without declaring a name for it. A function type could be one of the following: • The type of a variable or parameter to which a function can be assigned • An argument of a higher-order function taking a function parameter • The result type of higher-order function returning a function 59 Chapter 4 ■ Functional Programming in Scala The syntax for a function literal starts with a parenthesized comma−separated list of arguments followed by an arrow and the body of the function.

Listing 2-34 shows a basic try/catch expression with pattern matched catch block. 29 Chapter 2 ■ Basics of Scala Listing 2-34. parseInt and assigning a default if the call fails. Listing 2-35. parseInt and defaulting to 0 if an exception is thrown. parseInt does not fail. Listing 2-36. parseInt("44")} catch{case _ => 0} res17:Int = 44 Match Expressions Scala’s match expressions are used for pattern matching by allowing you to construct complex tests in very little code and are extremely flexible constructs that enable matching arbitrary items, such as types, content of the data structure, regular expressions, and even ranges of numeric types.

The following code defines a function literal that takes an Int parameter and returns a value that is twice the amount of the Int that is passed in: (i: Int) => { i * 2 } You can now assign that function literal to a variable: val doubler = (i: Int) => { i * 2 } scala> val doubler = (i: Int) => { i * 2 } doubler: Int => Int = The variable doubler is an instance of a function, known as a function value. You can now invoke doubler as illustrated here: doubler(2) scala> doubler(2) res25: Int = 4 Under the hood, doubler is an instance of the Function1 trait, which defines a function that takes one argument.

Download PDF sample

Beginning Scala by Vishal Layka, David Pollak


by Daniel
4.5

Rated 4.94 of 5 – based on 42 votes