Chapter 2. Your first Play application
This chapter covers
- Planning an example Play application
- Getting started with coding a Play application
- Creating the initial model, view templates, controllers, and routes
- Generating bar code images
- Validating form data
Now that you’ve seen how to download and install Play, and how to greet the world in traditional fashion, you’ll want to start writing some proper code, or at least read some. This chapter introduces a sample application that shows how a basic Play application fits together from a code perspective.
Although we’ll tell you what all of the code does, we’ll save most of the details and discussion until later chapters. We want you to have lots of questions as you read this chapter, but we’re not going to be able to answer all of them straight away.
This chapter will also help you understand the code samples in later chapters, which will be based on the same example.
Our example application is a prototype for a web-based product catalog, with information about different kinds of paperclips. We’ll assume it’s part of a larger warehouse management system, used for managing a supply chain. This may be less glamorous than unique web applications such as Twitter or Facebook, but then you’re more likely to be a commercial software developer building business applications than a member of Twitter’s core engineering team.[1]
1 Apart from anything else, this is the kind of business domain we work in.