Java 9 Programming Blueprints

Book description

Build a variety of real-world applications by taking advantage of the newest features of Java 9

About This Book

  • See some of the new features of Java 9 and be introduced to parts of the Java SDK

  • This book provides a set of diverse, interesting projects that range in complexity from fairly simple to advanced and cover HTTP 2.0

  • Take advantage of Java's new modularity features to write real-world applications that solve a variety of problems

  • Who This Book Is For

    This book is for Java developers who are already familiar with the language. Familiarity with more advanced topics, such as network programming and threads, would be helpful, but is not assumed.

    What You Will Learn

  • Learn how to package Java applications as modules by using the Java Platform Module System

  • Implement process management in Java by using the all-new process handling API

  • Integrate your applications with third-party services in the cloud

  • Interact with mail servers using JavaMail to build an application that filters spam messages

  • Learn to use JavaFX to build rich GUI based applications, which are an essential element of application development

  • Write microservices in Java using platform libraries and third-party frameworks

  • Integrate a Java application with MongoDB to build a cloud-based note taking application

  • In Detail

    Java is a powerful language that has applications in a wide variety of fields. From playing games on your computer to performing banking transactions, Java is at the heart of everything.

    The book starts by unveiling the new features of Java 9 and quickly walks you through the building blocks that form the basis of writing applications. There are 10 comprehensive projects in the book that will showcase the various features of Java 9. You will learn to build an email filter that separates spam messages from all your inboxes, a social media aggregator app that will help you efficiently track various feeds, and a microservice for a client/server note application, to name a few. The book covers various libraries and frameworks in these projects, and also introduces a few more frameworks that complement and extend the Java SDK.

    Through the course of building applications, this book will not only help you get to grips with the various features of Java 9, but will also teach you how to design and prototype professional-grade applications with performance and security considerations.

    Style and approach

    This is a learn-as-you-build practical guide to building full-fledged applications using Java 9. With a project-based approach, we’ll improve your Java skills. You will experience a variety of solutions to problems with Java.

    Table of contents

    1. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
        1. Downloading the example code
        2. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    2. Introduction
      1. New features in Java 8
        1. Lambdas
          1. Streams
        2. The new java.time package
        3. Default methods
      2. New features in Java 9
        1. Java Platform Module System/Project Jigsaw
        2. Process handling API
        3. Concurrency changes
        4. REPL
      3. Projects
        1. Process Viewer/Manager
        2. Duplicate File Finder
        3. Date Calculator
        4. Social Media Aggregator
        5. Email filter
        6. JavaFX photo management
        7. A client/server note application
        8. Serverless Java
        9. Android desktop synchronization client
      4. Getting started
      5. Summary
    3. Managing Processes in Java
      1. Creating a project
      2. Bootstrapping the application
      3. Defining the user interface
      4. Initializing the user interface
      5. Adding menus
      6. Updating the process list
      7. Summary
    4. Duplicate File Finder
      1. Getting started
      2. Building the library
        1. Concurrent Java with a Future interface
        2. Modern database access with JPA
      3. Building the command-line interface
      4. Building the graphical user interface
      5. Summary
    5. Date Calculator
      1. Getting started
      2. Building the library
        1. A timely interlude
          1. Duration
          2. Period
          3. Clock
            1. Instant
            2. LocalDate
            3. LocalTime
            4. LocalDateTime
            5. ZonedDateTime
          4. Back to our code
          5. A brief interlude on testing
      3. Building the command-line interface
      4. Summary
    6. Sunago - A Social Media Aggregator
      1. Getting started
        1. Setting up the user interface
        2. Setting up the controller
        3. Writing the model class
        4. Finishing up the controller
        5. Adding an image for the item
        6. Building the preferences user interface
        7. Saving user preferences
        8. Plugins and extensions with the Service Provider Interface
        9. Resource handling with try-with-resources
      2. Adding a network - Twitter
        1. Registering as a Twitter developer
        2. Adding Twitter preferences to Sunago
        3. OAuth and logging on to Twitter
        4. Adding a model for Twitter
        5. Implementing a Twitter client
        6. A brief look at internationalization and localization
        7. Making our JAR file fat
        8. Adding a refresh button
      3. Adding another network - Instagram
        1. Registering as an Instagram developer
        2. Implementing the Instagram client
        3. Loading our plugins in Sunago
      4. Summary
    7. Sunago - An Android Port
      1. Getting started
      2. Building the user interface
        1. Android data access
        2. Android services
        3. Android tabs and fragments
      3. Summary
    8. Email and Spam Management with MailFilter
      1. Getting started
      2. A brief look at the history of email protocols
        1. JavaMail, the Standard Java API for Email
        2. Building the CLI
        3. Building the GUI
        4. Building the service
      3. Summary
    9. Photo Management with PhotoBeans
      1. Getting started
      2. Bootstrapping the project
        1. Branding your application
      3. NetBeans modules
      4. TopComponent - the class for tabs and windows
      5. Nodes, a NetBeans presentation object
      6. Lookup, a NetBeans fundamental
      7. Writing our own nodes
      8. Performing Actions
      9. Services - exposing decoupled functionality
        1. PhotoViewerTopComponent
        2. Integrating JavaFX with the NetBeans RCP
        3. NetBeans preferences and the Options panel
          1. Adding a primary panel
          2. Adding a secondary panel
          3. Loading and saving preferences
          4. Reacting to changes in preferences
      10. Summary
    10. Taking Notes with Monumentum
      1. Getting started
        1. Microservice frameworks on the JVM
        2. Creating the application
        3. Creating REST Services
        4. Adding MongoDB
        5. Dependency injection with CDI
        6. Finish the notes resource
        7. Adding authentication
        8. Building the user interface
      2. Summary
    11. Serverless Java
      1. Getting started
      2. Planning the application
      3. Building your first function
        1. DynamoDB
        2. Simple Email Service
        3. Simple Notification Service
        4. Deploying the function
          1. Creating a role
          2. Creating a topic
          3. Deploying the function
          4. Testing the function
          5. Configuring your AWS credentials
      4. Summary
    12. DeskDroid - A Desktop Client for Your Android Phone
      1. Getting started
      2. Creating the Android project
        1. Requesting permissions
        2. Creating the service
      3. Server-sent events
        1. Controlling the service state
        2. Adding endpoints to the server
          1. Getting conversations
          2. Sending an SMS message
      4. Creating the desktop application
        1. Defining the user interface
        2. Defining user interface behavior
        3. Sending messages
        4. Getting updates
        5. Security
          1. Securing the endpoints
          2. Handling authorization requests
          3. Authorizing the client
      5. Summary
    13. What is Next?
      1. Looking back
      2. Looking forward
        1. Project Valhalla
          1. Value types
          2. Generic specialization
          3. Reified generics
        2. Project Panama
        3. Project Amber
          1. Local-Variable Type Inference
          2. Enhanced enums
          3. Lambda leftovers
      3. Looking around
        1. Ceylon
        2. Kotlin
      4. Summary

    Product information

    • Title: Java 9 Programming Blueprints
    • Author(s): Jason Lee
    • Release date: July 2017
    • Publisher(s): Packt Publishing
    • ISBN: 9781786460196