没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
This book is obviously targeted mostly for developers. We want to help Java programmers to get started and feel comfortable with both the syntax of the language and the tools. We will achieve this by exploring progressively some of the new concepts brought by Scala, in particular, how to unify the best of Object-Oriented and functional programming without giving away any of the established and mature technologies built around Java for the past fifteen years.
资源推荐
资源详情
资源评论
2
Table of Contents
Credits
..........................................................................................................................................................
6
Foreword
..................................................................................................................................................
8
About the Author
........................................................................................................................................
9
Acknowledgments
......................................................................................................................................
9
About the Reviewers
................................................................................................................................
10
Support files, eBooks, discount offers, and more
................................................................................
12
Preface
.....................................................................................................................................................
13
What this book covers
..............................................................................................................................
14
What you need for this book
...................................................................................................................
16
Who this book is for
.................................................................................................................................
16
Conventions
...............................................................................................................................................
16
Reader feedback
........................................................................................................................................
17
Customer support
.....................................................................................................................................
18
Chapter 1. Programming Interactively within Your Project
..............................................
19
Advantages of using Scala for Java projects
.........................................................................................
19
Learning Scala through the REPL
.........................................................................................................
23
Operations on collections
........................................................................................................................
33
Summary
...................................................................................................................................................
42
Chapter 2. Code Integration
...........................................................................................................
44
Creating a REST API from an existing database
.................................................................................
44
Adding a test in Scala
..............................................................................................................................
49
Setting up Scala within a Java Maven project
.....................................................................................
50
Scala and Java collaboration
..................................................................................................................
52
Differences in style between Java and Scala code
...............................................................................
62
Summary
...................................................................................................................................................
66
Chapter 3. Understanding the Scala Ecosystem
.....................................................................
67
Inheriting Java Integrated Development Environments (IDEs)
......................................................
67
Building with Simple Build Tool (SBT)
................................................................................................
68
Experimenting with Scala Worksheets
.................................................................................................
76
Working with HTTP
.................................................................................................................................
78
3
Taking advantage of Typesafe Activator
...............................................................................................
87
The REPL as a scripting engine
..............................................................................................................
91
Summary
...................................................................................................................................................
93
Chapter 4. Testing Tools
..................................................................................................................
94
Writing tests with ScalaTest
...................................................................................................................
94
Testing with ScalaCheck
.......................................................................................................................
108
Summary
..................................................................................................................................................
112
Chapter 5. Getting Started with the Play Framework
.........................................................
113
Getting started with the classic Play distribution
..............................................................................
114
Getting started with the Typesafe Activator
.......................................................................................
116
Architecture of a Play application
.........................................................................................................
117
Playing with authentication
..................................................................................................................
127
Practical tips when using Play
..............................................................................................................
131
Summary
.................................................................................................................................................
132
Chapter 6. Database Access and the Future of ORM
..........................................................
133
Integrating an existing ORM – Hibernate and JPA
..........................................................................
133
Dealing with persistence in the Play Framework
..............................................................................
142
Replacing ORM
......................................................................................................................................
145
Learning about Slick
..............................................................................................................................
145
Scaffolding a Play application
...............................................................................................................
151
Summary
..................................................................................................................................................
161
Chapter 7. Working with Integration and Web Services
..................................................
162
Binding XML data in Scala
...................................................................................................................
162
Working with XML and JSON
..............................................................................................................
171
Handling Play requests with XML and JSON
....................................................................................
178
Summary
.................................................................................................................................................
190
Chapter 8. Essential Properties of Modern Applications – Asynchrony and
Concurrency
........................................................................................................................................
191
The pillars of Concurrency
....................................................................................................................
191
The Async library – SIP-22-Async
.......................................................................................................
192
Getting started with Akka
.....................................................................................................................
198
4
Summary
.................................................................................................................................................
212
Chapter 9. Building Reactive Web Applications
..................................................................
214
Describing reactive applications
..........................................................................................................
214
Handling streams reactively
.................................................................................................................
214
Experimenting with WebSockets and Iteratees in Play
....................................................................
221
Learning from activator templates
.....................................................................................................
224
Playing with Actor Room
......................................................................................................................
227
Summary
.................................................................................................................................................
236
Chapter 10. Scala Goodies
.............................................................................................................
237
Exploring MongoDB
..............................................................................................................................
237
Scratching the surface of Big Data
......................................................................................................
244
Introducing DSLs in Scala
....................................................................................................................
246
Introducing Scala.js
...............................................................................................................................
251
Final tips
.................................................................................................................................................
254
Summary
.................................................................................................................................................
256
Index
......................................................................................................................................................
258
5
Scala for Java Developers
Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly or
indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies
and products mentioned in this book by the appropriate use of capitals. However, Packt
Publishing cannot guarantee the accuracy of this information.
First published: April 2014
Production Reference: 1180414
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-363-7
www.packtpub.com
Cover Image by Grégoire Alexandre (<contact@gregoirealexandre.com>)
剩余269页未读,继续阅读
资源评论
github_31680605
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于SimPy和贝叶斯优化的流程仿真系统.zip
- (源码)基于Java Web的个人信息管理系统.zip
- (源码)基于C++和OTL4的PostgreSQL数据库连接系统.zip
- (源码)基于ESP32和AWS IoT Core的室内温湿度监测系统.zip
- (源码)基于Arduino的I2C协议交通灯模拟系统.zip
- coco.names 文件
- (源码)基于Spring Boot和Vue的房屋租赁管理系统.zip
- (源码)基于Android的饭店点菜系统.zip
- (源码)基于Android平台的权限管理系统.zip
- (源码)基于CC++和wxWidgets框架的LEGO模型火车控制系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功