没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
Layka
Pollak
US $49.99
Shelve in
Programming Languages /Java
User level:
Beginning–Intermediate
www.apress.com
SOURCE CODE ONLINE
BOOKS FOR PROFESSIONALS BY PROFESSIONALS
®
Beginning Scala
Beginning Scala, Second Edition takes a down-to-earth approach to teaching
Scala that leads you through simple examples that can be combined to build
complex, scalable systems and applications.
This book introduces you to the Scala programming language, its object-oriented
and functional programming characteristics, and then guides you through Scala
constructs and libraries that allow you to assemble small components into
high-performance, scalable systems. You will learn why Scala is judiciously used
for critical business applications by leading companies such as Twitter, LinkedIn,
Foursquare, the Guardian, Morgan Stanley, Credit Suisse, UBS, and HSBC.
Scala is a multi-paradigm programming language that combines both functional
and object-oriented features. Moreover, this highly scalable language lends
itself well to building cloud-based/deliverable Software as a Service (SaaS) online
applications.
• Understand the basic syntax and mechanisms for writing Scala programs
• Learn the object-oriented features of Scala
• Use Scala’s functional programming features to define and
manage concurrency
• Build parsers using Scala’s library of parser combinators
• Create and manipulate XML content using Scala
• Take advantage of Scala’s standard annotations and even create your own
• Integrate and reuse an existing Java codebase
• Build projects that contain both Scala and Java code and dependencies
• Use Scala libraries and Scala web frameworks such as Play 2 to build
web applications with Scala
SECOND
EDITION
RELATED
9781484 202333
54999
ISBN 978-1-4842-0233-3
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
iii
Contents at a Glance
About the Authors �������������������������������������������������������������������������������������������������� xiii
About the Technical Reviewer ���������������������������������������������������������������������������������xv
Introduction �����������������������������������������������������������������������������������������������������������xvii
Chapter 1: Getting Started with Scala ■ ������������������������������������������������������������������ 1
Chapter 2: Basics of Scala ■ ���������������������������������������������������������������������������������� 13
Chapter 3: Object Orientation in Scala ■ ���������������������������������������������������������������� 33
Chapter 4: Functional Programming in Scala ■ ������������������������������������������������������ 57
Chapter 5: Pattern Matching ■ ������������������������������������������������������������������������������� 73
Chapter 6: Scala Collections ■ �������������������������������������������������������������������������������� 91
Chapter 7: Traits ■ ������������������������������������������������������������������������������������������������ 121
Chapter 8: Scala Type System ■ ��������������������������������������������������������������������������� 133
Chapter 9: Scala and Java Interoperability ■ ������������������������������������������������������� 153
Chapter 10: DSL and Parser Combinator ■ ����������������������������������������������������������� 165
Chapter 11: Simple Build Tool - SBT ■ ������������������������������������������������������������������ 179
Chapter 12: Scala for Web Application ■ �������������������������������������������������������������� 191
Chapter 13: Scala Best Practices ■ ��������������������������������������������������������������������� 219
Index ��������������������������������������������������������������������������������������������������������������������� 235
xvii
Introduction
Ouch! at hurts my brain! Stop making me think dierently. Oh, wait . . . it hurts less now. I get it. is
dierent way of solving the problem has some benets. I felt that way after my rst year of law school. I felt
that way for a while when I began coding Scala. What’s this Option thingy? Give me back my null! How do
you get the fth element from a Seq? On and on it went. Day after day of head-splitting paradigm changing
and breaking 30 years of coding habits, I am somewhat at peace with the Scala way of coding. Yes, my coding
habits were borne out of 6800 machine code coding. Talk about imperative coding. at’s all you’ve got when
you’ve got an accumulator, a program counter, and an index register. I grew up through BASIC, Pascal, C,
C++, Objective-C, and Java. And along comes this Scala stu, this functional-objective way of thinking,
these compositional design patterns. Who thought up this wacky stu?
After more than two years of coding Scala, I’ve come to understand that the Scala idioms are really
better. My brain has nally stopped hurting. I’ve nally stopped ghting for ow of control statements. I see
that it’s more important for me to take small elements and compose them together into complex systems.
I understand that if a method always returns the same output given the same input, I can safely glue that
function together with other functions into a very complex structure. I understand that explicit looping in my
code is a distraction from the business logic that is buried in the code. My path was hard, and I hope yours
will be easier.
e rst step in writing Scala is not being afraid of the fact that Scala’s going to warp your brain. e next
step in writing Scala is accepting that your code is going to look like Java, Ruby, Python, whatever code for a
while. It will take you time and eort and more time to code Scala using the idioms in this book. It will take
you time to design code that ts into Scala paradigms and to discover and devise paradigms of your own.
It will take time but hopefully less time than it took me.
is book is for you. It’s my attempt to show you a dierent way of thinking about and writing code.
I hope that you’ll enjoy our journey through Scala together. I hope that by the end of this book you’ll have a
new perspective on coding. I hope that you’ll be writing better code and fewer lines of code yet are happier
about the code that you’re writing. So, come along. Stick that little toe in the Scala waters and see if they feel
as good for you as they have for me.
Who This Book Is For
is book is for folks with some programming background who want to dip their little toe into Scala, check
the temperature, and perhaps wade in some more.
How This Book Is Structured
Chapters 1 through 3 are meant to give you a basic grounding in Scala syntax and Scala idioms.
Chapters 4 through 7 tour key Scala features, including functions, pattern matching, Scala Collections and
traits. Chapter 8 is a deep dive into Scala’s type system. Chapter 9 discusses Scala and Java interoperability.
Chapter 10 rolls the pieces together with an exploration of DSLs and Scala’s parser combinator library.
Chapter 11 discusses the standard build tool SBT. Chapter 12 shows how to develop web applications using
Scala web framework. Chapter 13 discusses some best practices for Scala.
■ IntroduCtIon
xviii
Prerequisites
You should have the Java JDK 1.6 or higher installed on your machine as well as Scala 2.10 or higher.
Downloading the Code
e source code for this book is available to readers under the Source Code/Downloads tab of this book’s
home page, which is located at www.apress.com/9781484202333.
剩余245页未读,继续阅读
资源评论
- Joel.Wang老王2015-07-19这真的是入门scala的好书,可以以这本书快速入门。
gemire
- 粉丝: 34
- 资源: 7
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 橙色宽屏风格的建筑工程企业网站源码下载.zip
- 橙色宽屏风格的金融外汇投资网站模板下载.zip
- 橙色宽屏风格的咖啡休闲屋网站模板下载.zip
- 橙色宽屏风格的酒店自助餐美食企业网站模板.rar
- 橙色宽屏风格的力量训练健身中心源码下载.zip
- 橙色宽屏风格的美工前端团队展示网站模板下载.zip
- 橙色宽屏风格的马场俱乐部源码下载.zip
- 橙色宽屏风格的农场种植整站网站模板.zip
- 橙色宽屏风格的美食甜品站企业网站模板.zip
- 橙色宽屏风格的美食西餐甜点模板下载.zip
- 橙色宽屏风格的农作物种植网站模板下载.zip
- 橙色宽屏风格的欧美现代厨房网站模板下载.zip
- 橙色宽屏风格的欧洲别墅家居企业网站模板.zip
- 橙色宽屏风格的企业网站商务模板.zip
- 橙色宽屏风格的商业网页CSS模板下载.zip
- 橙色宽屏风格的汽车清洗美容公司模板下载.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功