We’re excited to announce the release of a mini development guide Programming APIs With the Spark Web Framework. Learn how to master Spark, a free open source micro framework that can be used to develop powerful APIs alongside JVM-based programming languages. Visit our eBooks page today to grab a FREE copy. Or, download straight to your Kindle from Amazon or Leanpub.
Our new eBook:
Programming APIs With the Spark Web Framework
Preface by Spark Founder Per Wendel:
Often when developers think about Java web development they immediately think of huge frameworks, cumbersome configuration and lots of boilerplate code. As with many other areas of Java development – Cargo-cult conventions, guidelines and habits tend to hold back the language’s evolution and hinders it from reaching its full potential. Spark aims to address these problems directly, which is one of the major reasons behind its rapid growth and popularity in the Java world.
Spark Framework utilizes the new language features of Java 8 and gives a much needed injection of energy to the many Java web developers exhausted by the “old ways” of doing things. Spark has no XML, no annotations, minimal configuration and a convention breaking, sleek yet expressive syntax. Spark’s goal is to rejuvenate and streamline Java web development, and in the long run, help the language itself evolve.
With a clear philosophy Spark is designed not only to make you more productive, but also to make your code better under the influence of Spark’s sleek and declarative syntax.
Hundreds of thousands of developers have already started to adopt to the Spark mindset. The question is: Are you ready to be ignited?
This guidebook collects our research, reviews, and code walkthroughs centered around the tiny Java web framework Spark (Not to be confused with the data processing framework Apache Spark). In addition to Spark, this mini code-heavy ebook introduces some new technologies that our authors are using internally and would like to share with the web development community. We sponsored the Stockholm Java meetup earlier this year to discuss using Kotlin, Clojure, and Groovy to build APIs on the JVM, and have included some of those insights as well.
Throughout the course of this guide, we introduce the benefits of using the Spark web framework. We’ll demonstrate how it works with Java, and compare language behavior with other languages like Kotlin, Go, and Scala. Read on to learn how to use Spark to build APIs for speed, productivity, purpose, and cloud readiness.
Table of Contents
- 1. Introduction
- 2. Using Spark to Create APIs in Java
- 2.1 Introducing Spark
- 2.2 More Complicated Example
- 2.3 Templatized Responses
- 2.4 Spark Compared
- 2.5 Benefits of Spark
- 3. Introducing Kotlin to the JVM
- 3.1 Introducing the JVM
- 3.2 Enter Kotlin
- 3.3 Why Kotlin?
- 3.4 Examples of Kotlin’s Syntax
- 3.5 Functions and Constructors
- 3.6 Named Arguments and Passing Function Literals
- 3.7 Generics
- 3.8 Data Classes
- 3.9 Smart Casts
- 3.10 Using Kotlin
- 3.11 Converting Existing Code
- 3.12 Compiling Kotlin
- 3.13 Debugging
- 3.14 Conclusion
- 4. Building APIs on the JVM using Kotlin and Spark
- 4.1 Recapped Intro to Spark
- 4.2 Building a Robust API with Spark
- 4.3 Templating in Kotlin
- 4.4 Adding DI Capabilities to a Spark-based API
- 4.5 Implementing API Logic in Controllers
- 4.6 Conclusion and Next Steps
- 5. Using Spark to Create APIs in Scala
- 5.1 Reintroducing Spark
- 5.2 Scala — It’s Origin and Purpose
- 5.3 Why Scala? Why Not Java?
- 5.4 Different, More Efficient Methods
- 5.5 Scala Performance and Integration
- 5.6 Conclusion
Pricing & Download
The book is FREE to download straight from the Nordic APIs eBook page. However, if you would like to support Nordic APIs, you can purchase the eBook through Leanpub and name your price, or download it for $0.99 through the Amazon store.
Visit our eBook Page to Download
Bookmark our eBook page, and keep on the lookout for our next upcoming release – The API Economy: Disruption and the Business of APIs – a guide to the ever evolving landscape of the API space, and the potential for new industry disruption. Track our progress on Leanpub
As always, we welcome feedback in the comments below, or on our Twitter, Linkedin, or Google+ pages. Please enjoy Programming APIs With the Spark Web Framework, and let us know how we can improve. Be sure to join the Nordic APIs newsletter for news about upcoming events as well as blog and eBook updates.