O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data-Centric Applications with Vaadin 8

Book Description

This book teaches you everything you need to know to create stunning Vaadin applications for all your web development needs. Deep dive into advanced Vaadin concepts while creating your very own sample Vaadin application.

About This Book
  • A one-stop book to enhance your working knowledge with Vaadin.
  • Explore and implement the architecture of Vaadin applications.
  • Delve into advanced topics such as data binding, authentication and authorization to improvise your application's performance.
Who This Book Is For

If you area Software developer with previous experience with Vaadin and would like to gain more comprehensive and advanced skills in Vaadin web development, then this book is for you.

What You Will Learn
  • Modularize your Vaadin applications with Maven
  • Create high quality custom components
  • Implement robust and secure authentication and authorization mechanisms
  • Connect to SQL databases efficiently
  • Design robust CRUD (Create, Read, Update, Delete) views
  • Generate stunning reports
  • Improve resource consumption by using lazy loading
In Detail

Vaadin is an open-source Java framework used to build modern user interfaces. Vaadin 8 simplifies application development and improves user experience. The book begins with an overview of the architecture of Vaadin applications and the way you can organize your code in modules.Then it moves to the more advanced topics about advanced topics such as internationalization, authentication, authorization, and database connectivity. The book also teaches you how to implement CRUD views, how to generate printable reports, and how to manage data with lazy loading.

By the end of this book you will be able to architect, implement, and deploy stunning Vaadin applications, and have the knowledge to master web development with Vaadin.

Style and approach

This book follows a hands-on approach and takes the readers through practical examples of how to create and deploy Vaadin applications. This book teaches the readers about the Vaadin architecture. It then moves on to the more advanced topics about advanced topics such as internationalization, authentication, authorization, and database connectivity. This step by step guide equips the readers with all they need to know to use Vaadin for web development.

Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Data-Centric Applications with Vaadin 8
  3. Dedication
  4. Packt Upsell
    1. Why subscribe?
    2. PacktPub.com
  5. Foreword
  6. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  7. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Code in Action
      4. Conventions used
    4. Get in touch
      1. Reviews
  8. Creating New Vaadin Projects
    1. Technical requirements
    2. About the demo applications
      1. Understanding the source code
    3. Understanding the architecture of a Vaadin application
      1. Creating a new project from scratch
      2. Maven dependencies
      3. Servlets and UIs
      4. Maven plugins
      5. Components and layouts
      6. Listeners and binders
        1. Events and listeners
      7. Data binding
      8. Resources and themes
      9. Widget sets and add-ons
    4. Summary
  9. Modularization and Main Screens
    1. Technical requirements
    2. Creating a multi-module Maven project
    3. Implementing an application's main screen
      1. Defining an API for an application's main screen
      2. Implementing support classes
      3. Implementing a concrete application's main screen
        1. Adding and configuring the required UI components
        2. Implementing the ApplicationLayout interface
        3. Implementing the menu
    4. Modularizing Vaadin applications
    5. Identifying alternatives for modularization
      1. Registering modules with the application
      2. Discovering modules
      3. Implementing new modules
    6. Summary
  10. Implementing Server-Side Components with Internationalization
    1. Technical requirements
    2. Using extensions to develop a UI component
      1. Extending VerticalLayout
      2. Why avoid extension?
    3. Using composition to develop custom components
      1. Implementing a factory
      2. Using the Composite class
      3. Using the LoginForm class
    4. Using internationalization for Multiple Language Support
      1. Removing hardcoded strings
      2. Getting localized strings
      3. Getting and setting the locale
    5. Summary
  11. Implementing Authentication and Authorization
    1. Technical requirements
    2. Implementing public and private views
    3. Using the HTTP session and cookies to identify users
      1. Keeping track of authenticated users
      2. Implementing the login/logout process
      3. Implementing the remember me feature
    4. Enabling features according to a user's roles
      1. Coding authorization logic in UI components
      2. Coding authorization using request data
        1. Getting request information
        2. Routing requests to a UI component
        3. Coding authorization with the help of a Navigator
    5. Summary
  12. Connecting to SQL Databases Using JDBC
    1. Technical requirements
    2. Introduction to JDBC
      1. Adding a JDBC driver for your database
      2. Establishing a database connection through a connection pool
      3. Creating a statement and executing an SQL query
      4. Getting and processing a result set
      5. Closing a database connection
    3. Implementing data repositories
      1. Defining a domain model
      2. Implementing repositories and services
      3. The active record pattern
    4. Summary
  13. Connecting to SQL Databases Using ORM Frameworks
    1. Technical requirements
    2. Using object-relational mapping frameworks
    3. Connecting to SQL databases using JPA
      1. Defining a persistence unit
      2. Creating an EntityManagerFactory
      3. Implementing Entity classes
      4. Executing queries
      5. Implementing a Vaadin UI to list and save Entities
    4. Connecting to SQL databases using MyBatis
      1. Defining a database connection
      2. Implementing mapper classes
      3. Implementing a service class
    5. Connecting to SQL databases using jOOQ
      1. Defining a database connection
      2. Reverse-engineering the database schema
      3. Running queries
    6. Summary
  14. Implementing CRUD User Interfaces
    1. Technical requirements
    2. CRUD user interface design
      1. In-place fields
      2. Modal pop-up windows
      3. Hierarchical menus
    3. The domain model
    4. Implementing a CRUD using an editable Grid component
      1. Implementing the read operation
      2. Implementing the update operation
      3. Adding Bean Validation with JSR-303
    5. Implementing a CRUD using Grids and forms
      1. Implementing the read operation
      2. Implementing the create and update operations
      3. Implementing the delete operation
      4. Using the Crud UI add-on
      5. Filtering
    6. Summary
  15. Adding Reporting Capabilities
    1. Technical requirements
    2. The example application
      1. The data model
      2. The Vaadin UI
    3. Integrating JasperReports with Vaadin
      1. Getting the data
      2. Designing the report
      3. Rendering a report as HTML
      4. Adding charts
    4. Generating a report in a background task
      1. Exporting a report to a PDF
      2. Server Push
    5. Summary
  16. Lazy Loading
    1. Technical requirements
    2. The example application
      1. The data model
      2. The Vaadin UI
    3. Preparing the backend for lazy loading
    4. Lazy loading with the Grid component
      1. Adding filters
    5. Ordering rows in Grid components
      1. Preparing the backend services
      2. Enabling ordering in the UI
    6. UX and large datasets
      1. Lazy loading Grid versus direct search
      2. Infinite lazy loading
    7. Summary
  17. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think