Cover image for Scala for Java Developers.
Scala for Java Developers.
Title:
Scala for Java Developers.
Author:
Alexandre, Thomas.
ISBN:
9781783283644
Personal Author:
Physical Description:
1 online resource (296 pages)
Contents:
Scala for Java Developers -- Table of Contents -- Scala for Java Developers -- Credits -- Foreword -- About the Author -- Acknowledgments -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers, and more -- Why Subscribe? -- Free Access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. Programming Interactively within Your Project -- Advantages of using Scala for Java projects -- More concise and expressive -- Increased productivity -- Natural evolution from Java -- Better fit for asynchronous and concurrent code -- Learning Scala through the REPL -- Declaring val/var variables -- Defining classes -- Explaining case classes -- Operations on collections -- Transforming collections containing primitive types -- Collections of more complex objects -- Filter and partition -- Dealing with tuples -- Introducing Map -- Introducing the Option construct -- A glimpse at pattern matching -- The map method -- Looking at String Interpolation -- The groupBy method -- The foldLeft method -- Summary -- 2. Code Integration -- Creating a REST API from an existing database -- The sample database -- Setting up a Maven project -- Creating JPA entities and REST web services -- Running and testing the project -- Adding a unit test in Java -- Adding a test in Scala -- Setting up Scala within a Java Maven project -- Scala and Java collaboration -- Converting between collection types -- JavaBean-style properties -- Scala and Java object orientation -- Scala traits as enhanced Java interfaces -- Declaring objects -- Introducing companion objects -- Handling exceptions -- Differences in style between Java and Scala code -- Adjusting the code layout.

Naming conventions -- Summary -- 3. Understanding the Scala Ecosystem -- Inheriting Java Integrated Development Environments (IDEs) -- Building with Simple Build Tool (SBT) -- Getting started with SBT -- Creating a sample project -- Importing the project in Eclipse, IntelliJ IDEA, and NetBeans -- Creating a web application that runs on a servlet container -- Using sbt-assembly to build a single .jar archive -- Formatting code with Scalariform -- Experimenting with Scala Worksheets -- Working with HTTP -- Scala's for comprehension -- Taking advantage of Typesafe Activator -- Creating an application based on activator templates -- The REPL as a scripting engine -- Summary -- 4. Testing Tools -- Writing tests with ScalaTest -- BDD-style testing -- Functional testing -- Mocking with ScalaMock -- Testing with ScalaCheck -- Summary -- 5. Getting Started with the Play Framework -- Getting started with the classic Play distribution -- Getting started with the Typesafe Activator -- Architecture of a Play application -- Visualizing the framework stack -- Exploring the request-response lifecycle -- Handling a request in the controller -- Rendering the view -- Playing with authentication -- Practical tips when using Play -- Debugging with Play -- Dealing with version control -- Summary -- 6. Database Access and the Future of ORM -- Integrating an existing ORM - Hibernate and JPA -- Making JPA available in Scala -- Dealing with persistence in the Play Framework -- A simple example using Anorm -- Replacing ORM -- Learning about Slick -- Scaffolding a Play application -- Importing test data -- Visualizing the database in the H2browser -- Exploring the code behind the app generation -- Limitations of the playcrud utility -- Summary -- 7. Working with Integration and Web Services -- Binding XML data in Scala -- Running scalaxb from a SOAP web service.

Working with XML and JSON -- Manipulating XML -- Manipulating JSON -- Using Play JSON -- Handling Play requests with XML and JSON -- Mocking Play responses with JSON -- Calling web services from Play -- Summary -- 8. Essential Properties of Modern Applications - Asynchrony and Concurrency -- The pillars of Concurrency -- The Async library - SIP-22-Async -- Combining web services -- Combining services without await -- Getting started with Akka -- Understanding the Actor model -- Switching behavior -- Supervising actors to handle failure -- Testing actor systems -- Exploring further with Akka -- Summary -- 9. Building Reactive Web Applications -- Describing reactive applications -- Handling streams reactively -- Understanding Iteratees in Play -- Adapting Enumerator with Enumeratee -- Experimenting with WebSockets and Iteratees in Play -- Learning from activator templates -- Reactive stocks -- Reactive real-time search -- The Play-Akka-Angular-WebSocket template -- Playing with Actor Room -- Summary -- 10. Scala Goodies -- Exploring MongoDB -- Entering Casbah -- Applying MapReduce transformations -- Scratching the surface of Big Data -- Introducing DSLs in Scala -- Observing internal DSLs -- Tackling external DSLs through parser combinators -- Introducing Scala.js -- Final tips -- Copying and pasting in the REPL -- Timing code execution in the REPL -- Summary -- Index.
Abstract:
This step-by-step guide is full of easy-to-follow code taken from real-world examples explaining the migration and integration of Scala in a Java project. If you are a Java developer or a Java architect, working in Java EE-based solutions and want to start using Scala in your daily programming, this book is ideal for you. This book will get you up and running quickly by adopting a pragmatic approach with real-world code samples. No prior knowledge of Scala is required.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: