E-book details

Instant Play Framework Starter. Build your web applications from the ground up with the Play Framework for Java and Scala

Instant Play Framework Starter. Build your web applications from the ground up with the Play Framework for Java and Scala

Daniel Dietrich

Ebook
Play is a full-featured Java and Scala web framework for building modern, high-performance web applications. It is characterized by its simplicity and scalability. With its lightweight, stateless, and web-friendly architecture, Play focuses on developer experience to make web application development fun.Instant Play Framework Starter is the ideal companion to start developing web applications with Play. The building blocks of a typical web application are carefully designed following an on-going example.Instant Play Framework Starter starts with a quick setup and running a first sample. Then, the anatomy of a typical Play application is outlined. More features are added step by step to an example application. The result is the prototype of a highly scalable web application.The example is implemented in Java and in Scala. It consists of building blocks you will find in every Play application. In particular, you will learn how views are rendered with the template engine, how HTTP routes are used to define the navigation rules, and how to separate the application logic of controllers from the business logic of the model. This separation is the result of a careful application design, which makes it easy to add features like data binding and validation. Finally you will see how easy it is to adapt different database access libraries.

Instant Play Framework Starter will help you to get started with Play and develop your first application. Packed with examples, it is easy to follow the design of a real-world application. You are able to compare the difference between a Java- and a Scala-based Play application and to decide which language fits your needs best. All topics covered in the book are described with the aim to serve as a reference for future web application development with Play.
  • Instant Play Framework Starter
    • Instant Play Framework Starter
    • Credits
    • About the Author
    • About the Reviewers
    • www.packtpub.com
      • Support files, eBooks, discount offers and more
    • packtlib.packtpub.com
      • Why Subscribe?
      • Free Access for Packt account holders
    • 1. Instant Play Framework Starter
      • So, what is Play?
      • Installation
        • Step 1 What do I need?
        • Step 2 Downloading Play
        • Step 3 Setting the PATH environment variable
        • Step 4 Testing the Play installation
        • And thats it!
      • Quick start Creating your first Play application
        • Step 1 Creating a new Play application
          • Structure of a Play application
            • The app/ folder
            • The conf/ directory
            • The project/ folder
            • The public/ folder
            • The test/ folder
        • Step 2 Using the Play console
          • Starting our application
          • Play console commands
          • Closing the console
        • Step 3 Modifying our application
          • Fast turnaround change your code and hit reload!
          • Stripped down and optimized stack traces
        • Step 4 Setting up your preferred IDE
          • IntelliJ IDEA
          • Eclipse
          • Other IDEs
      • Top features you need to know about
        • 1 Designing a Play application
          • Introducing our sample application
          • Defining the domain model
            • The Java model
            • The Scala model
          • Designing the HTTP interface with the routes file
            • Defining the application routes
            • Dynamic request paths and variables
            • Testing the routes
          • Handling HTTP requests by controller actions
            • Providing dummy implementations
            • URL redirection with reverse routes
            • Implementing controller actions
            • The Java code
            • The Scala code
              • What comes next
          • Composing the UI from view templates
            • Syntax of view templates
              • View parameters
              • View imports
              • View expressions
            • Composing view templates
              • Example
              • Nesting view templates
          • Implementing the phone book views
            • Prerequisites
            • The index view template
            • The list view template
            • The main view template
              • Fine-tuning the CSS style
            • Providing some test data
        • 2 Dealing with user input
          • Defining a form
            • The server side
              • Binding data with a Java form
              • Binding data with a Scala form
            • The client side
          • Validating user input
            • The server side
              • Defining constraints in Java
              • Defining constraints in Scala
            • The client side
          • Using form template helpers
        • 3 Connecting to a database
          • Accessing data with Ebean for Java
            • Customizing the configuration
            • Creating the database schema
            • Implementing the model
            • Running the application
          • Accessing data with Anorm for Scala
            • Customizing the configuration
            • Creating the database schema
            • Implementing the model
            • Running the application
          • Accessing data with Slick for Scala
            • Customizing the configuration
            • Implementing the model
              • The data access object
              • The data access layer
            • Generating the database schema
      • People and places you should get to know
        • Official sites
        • Articles and tutorials
        • Community
        • Blogs
        • Twitter
  • Title: Instant Play Framework Starter. Build your web applications from the ground up with the Play Framework for Java and Scala
  • Author: Daniel Dietrich
  • Original title: Instant Play Framework Starter. Build your web applications from the ground up with the Play Framework for Java and Scala
  • ISBN: 9781782162919, 9781782162919
  • Date of issue: 2013-05-23
  • Format: Ebook
  • Item ID: e_2wak
  • Publisher: Packt Publishing