Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Spring Roo 1.1 Cookbook
Spring Roo 1.1 Cookbook

Spring Roo 1.1 Cookbook: Over 60 recipes to help you speed up the development of your Java web applications using the Spring Roo development tool

eBook
€8.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Spring Roo 1.1 Cookbook

Chapter 2. Persisting Objects Using JPA

In this chapter, we will cover:

  • Setting up a JPA provider for your project

  • Viewing database configuration properties

  • Managing database configuration properties

  • Creating persistent entities

  • Adding JSR 303 constraints to persistent fields

  • Creating integration tests for persistent entities

  • Creating new 'data on demand' for testing entities

  • Creating mock tests for persistent entities

  • Executing persistent entities tests

  • Controlling auto-generated methods of persistent entities

  • Creating applications that interact with multiple databases

  • Packaging your Roo project

Introduction


Java Persistence API (JPA) provides a standard API for persisting Java objects to a relational database. The recipes in this chapter look at Roo commands that configure the data source and JPA provider (for example, Hibernate and OpenJPA), and Roo commands that create persistent entities of your enterprise application.

If you're using Spring only in the persistence layer, you'll see in this chapter how Roo can be used to quickly develop the persistence layer of your application. You'll notice that applications generated using Roo don't have a DAO (Data Access Object) layer because the domain entities generated by Roo are themselves rich in flavor, with finder and CRUD methods defined in the persistent entities. Also, Roo-generated applications don't have a service layer for abstracting business services (which in turn could access persistent entities). If you want to create a service layer for your enterprise application, it is left up to you to create services. You should create...

Setting up a JPA provider for your project


In enterprise applications, data is persisted in one or more data stores. JPA provides a standard API for managing data in relational databases. In this task we'll look at the persistence setup command to configure a JPA persistence provider for a Roo project.

Getting ready

Create a sub-directory ch02-recipes inside the C:\roo-cookbook directory.

To set up a JPA provider, we first need to create a Roo project. To create a new Roo project, download ch02.roo file from the book's website and copy it to the ch02-recipes directory.

Open the command prompt and go to the ch02-recipes directory. Now, start the Roo shell and execute commands in ch02.roo script using the script command, as explained in the Creating application artifacts from a Roo script recipe of Chapter 1. Successful execution of the ch02.roo script creates a flight-app Eclipse project which you can import in your Eclipse IDE.

How to do it...

The following steps will demonstrate how to set up...

Viewing database configuration properties


In this recipe we'll see how the database properties list command lets us view the list of database properties and their values, as specified in the database.properties file.

Getting ready

Refer to the Setting up a JPA provider for your project recipe to create a flight-app Roo project and to set up a persistence provider using the persistence setup command.

Note

You won't need this recipe if you're using a JNDI-bound data source in your Roo project.

How to do it...

Follow these steps to view database properties:

  1. Start the Roo shell from the C:\roo-cookbook\ch02-recipes directory.

  2. To view database properties defined in the database.properties file located in SRC_MAIN_RESOURCES\META-INF\spring\ directory, you can use the database properties list command, as shown here:

    roo> database properties list
    
    database.driverClassName = com.mysql.jdbc.Driver
    database.password =
    database.url = jdbc:mysql://localhost:3306/myFlightAppDB
    database.username =
    

How it works...

Managing database configuration properties


In the previous recipe, we saw how we can view the database configuration properties defined in the database.properties file using the database properties list command. In this recipe, we'll look at how we can add, modify, or remove properties from the database.properties file using the database properties set and database properties remove commands.

The following table shows the properties that we'll add, modify, and remove from the database.properties file:

Property

Action

database.username

Modified to database.username = root

database.password

Modified to database.password = asarin

database.url = jdbc\:mysql\://localhost\:3306/myFlightAppDB

Removed from database.properties

database.modified.url = jdbc\:mysql\://localhost\:3406/myFlightAppDB

Added to database.properties

database.initialPoolSize=10

Added to database.properties

Getting ready

Refer to the Setting up a JPA provider for your project recipe to create the...

Creating persistent entities


In this recipe we look at how Spring Roo simplifies the creation of JPA entities using the entity and field commands. In this recipe we'll create a Flight JPA entity which has a composite primary key. Refer to the Creating a many-to-one relationship between entities recipe of Chapter 3, Advanced JPA Support in Spring Roo to see how to create persistent entities with surrogate keys.

The following figure shows the attributes of the Flight entity and its composite primary key (FlightKey):

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jpa_setup.roo script. It creates a flight-app Roo project and sets up Hibernate as the persistence provider using the persistence setup command. If you are using a different database than MySQL or your connection settings are different from what is specified in the script, then modify the script accordingly.

Start the Roo shell from the C:\roo-cookbook\ch02-recipes...

Adding JSR 303 constraints to persistent fields


JSR 303 (bean validation) defines a standard approach for annotations-based JavaBeans validation. In this recipe we'll look at how Spring Roo's field command can be used to add JSR 303 validation constraints to persistent fields of entities.

The following table shows the validation constraints that apply to fields defined in the Flight entity and FlightKey class of our flight-app project:

Persistent field

Constraint

JSR 303 annotation

Flight -> createdDate

Not null

@NotNull

Flight -> createdBy

Not null

@NotNull

Flight -> numOfSeats

Not null

Maximum seats 200

Minimum seats 100

@NotNull

@DecimalMax("200")

@DecimalMin("100")

Flight -> origin

Not null

Maximum length of value of origin is 20, minimum length is 3

@NotNull

@Size(min=3, max=20)

Flight -> destination

Not null

Maximum length of value of destination is 20, minimum length is 3

@NotNull

@Size(min=3, max=20)

FlightKey -> flightId...

Controlling auto-generated methods of persistent entities


When a persistent entity is created using Roo, a number of methods are auto-generated to simplify usage and testing of the entity. For instance, when the Flight entity was created in the Creating persistent entities recipe, the corresponding Flight_Roo_Entity.aj AspectJ ITD file was created with methods like persist, remove, merge, flush, findFlight, and so on.

In this recipe we'll look at how to control the generation of entity methods by:

  • Specifying the prefix to be used for a method

  • Instructing Roo not to generate a particular method

For the purpose of this recipe, we'll instruct Roo to do the following for the Flight entity:

  • Change the name of the persist auto-generated method to save

  • Change the name of the findFlight auto-generated method to finderForFlight

  • Don't generate countFlights and findFlightEntries methods

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jsr303_fields...

Creating integration tests for persistent entities


Spring Roo provides a test integration command that simplifies the creation of integration tests for persistent entities. In this recipe, we'll look at how to create an integration test for an entity.

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jsr303_fields.roo script. It creates a flight-app Roo project and sets up Hibernate as persistence provider using the persistence setup command. The script also creates a Flight entity, which has FlightKey as its composite primary key class, and adds fields to the Flight and FlightKey classes. If you are using a different database than MySQL or your connection settings are different from what is specified in the script, then modify the script accordingly.

Start the Roo shell from the C:\roo-cookbook\ch02-recipes directory.

How to do it...

The following steps will show you how to create integration tests:

  1. Change the focus of the...

Creating new 'data on demand' for testing entities


We saw in the previous recipe that the test integration command and testAutomatically argument of the entity command result in the generation of an integration test and seed data for an entity. In situations where you're creating your own integration tests, you may still want to use the Roo-generated seed data for an entity. So, you are writing your custom integration test class but using a Roo-generated 'data on demand' class. This is where the dod command of Spring Roo comes into the picture.

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jsr303_fields.roo script. It creates a flight-app Roo project and sets up Hibernate as the persistence provider using the persistence setup command. The script also creates a Flight entity, which has FlightKey as its composite primary key class, and adds fields to the Flight and FlightKey classes. If you are using a different database...

Creating mock tests for persistent entities


In the recipe Creating integration tests for persistent entities, we saw how Spring Roo helps with the creation of integration tests. In this recipe we look at how Spring Roo simplifies the generation of a mock test for an entity using the test mock command.

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jsr303_fields.roo script. It creates a flight-app Roo project and sets up Hibernate as the persistence provider using the persistence setup command. The script also creates a Flight entity, which has FlightKey as its composite primary key class, and adds fields to the Flight and FlightKey classes. If you are using a different database than MySQL or your connection settings are different from what is specified in the script, then modify the script accordingly.

Start the Roo shell from the C:\roo-cookbook\ch02-recipes directory.

How to do it...

Follow these steps to create mock tests...

Executing persistent entities tests


In previous recipes we saw how to create mock and integration tests for persistent entities. In this recipe we'll look at how to execute these tests using the perform tests command of Spring Roo.

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jsr303_fields.roo script. It creates a flight-app Roo project and sets up Hibernate as the persistence provider using the persistence setup command. The script also creates a Flight entity, which has FlightKey as its composite primary key class, and adds fields to the Flight and FlightKey classes. If you are using a different database than MySQL or your connection settings are different from what is specified in the script, then modify the script accordingly.

Install the MySQL 5.5.11 database—this is required because we'll now be executing integration tests. Create a database named "myFlightAppDB" in MySQL server instance and ensure that the connection...

Creating applications that interact with multiple databases


As of Spring Roo 1.1.3, both entity and persistence setup commands support the persistenceUnit argument which lets you create enterprise applications which interact with multiple databases. In this recipe we'll create two persistent units:

  • flight: the flight persistence unit consists of a single entity, Flight. It uses Hibernate as a JPA provider and maps to a MySQL database named "myFlightDB".

  • payment: the payment persistence unit consists of a single entity, Payment. It uses Hibernate as the JPA provider and maps to a MySQL database named "myPaymentDB".

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Start the Roo shell from the C:\roo-cookbook\ch02-recipes directory.

How to do it...

The following steps will demonstrate how to create an application that interacts with multiple databases:

  1. Create the flight-app Roo project:

    ..roo> project --topLevelPackage sample.roo.flightapp...

Packaging your Roo project


If you are using Roo only to create the persistence layer of your enterprise application, then you may want to package your Roo project as a JAR file and use it. This recipe shows how you can package your Roo project and how Roo ensures that your packaged JAR file is independent of Roo-specific annotations and AspectJ ITDs.

Getting ready

Exit the Roo shell and delete the contents of the C:\roo-cookbook\ch02-recipes directory.

Execute the ch02_jsr303_fields.roo script. It creates a flight-app Roo project and sets up Hibernate as persistence provider using the persistence setup command. The script also creates a Flight entity, which has FlightKey as its composite primary key class, and adds fields to the Flight and FlightKey classes. If you are using a different database than MySQL or your connection settings are different from what is specified in the script, then modify the script accordingly.

Start the Roo shell from the C:\roo-cookbook\ch02-recipes directory.

How...

Left arrow icon Right arrow icon

Key benefits

  • Learn what goes on behind the scenes when using Spring Roo and how to migrate your existing Spring applications to use Spring Roo
  • Incrementally develop a Flight Booking enterprise application from scratch as various features of Spring Roo are introduced
  • Develop custom add-ons to extend Spring Roo features
  • Full of tips and code for addressing common concerns related to developing a real enterprise application using Spring Roo

Description

Spring Roo is an easy-to-use productivity tool for rapidly developing Java enterprise applications using well-recognized frameworks such as Spring, Hibernate, AspectJ, Spring Web Flow, Spring Security, GWT, and so on. Spring Roo takes care of creating maven-enabled projects, enterprise application architecture based on your choice of technologies, unit/integration tests based on your choice of testing framework, and so on. The bottom line is that if you're using Spring, then you must consider using Spring Roo for increased productivity. Spring Roo 1.1 Cookbook brings together a collection of recipes that demonstrate how the Spring Roo developer tool simplifies rapidly developing enterprise applications using standard technologies/frameworks such as JPA, GWT, Spring, Flex, Spring Web Flow, Spring Security, and so on. It introduces readers to developing enterprise applications for the real world using Spring Roo tool. The book starts off with basic recipes to make readers comfortable with using Spring Roo tool. As the book progresses, readers are introduced to more sophisticated features supported by Spring Roo in the context of a Flight Booking application. In a step-by-step by fashion, each recipe shows how a particular activity is performed, what Spring Roo does when a command is executed, and why it is important in the context of the application being developed. Initially, you make a quick start with using Spring Roo through some simple recipes. Then you learn how Spring Roo simplifies creating the persistence layer of an enterprise application using JPA. You are introduced to the various roo commands to create JPA entities, create relationships between JPA entities, create integration tests using Spring TestContext framework, and so on. Following this, the book shows you how Spring Roo simplifies creating the web layer of an enterprise application using Spring Web MVC, Spring Web Flow, and how to create selenium tests for controller objects. Subsequently, we focus on using Spring-BlazeDS, GWT, JSON, and so on. Spring Roo commands that are used to incorporate e-mail/messaging features into an enterprise application are demonstrated next. Finally, we wrap it up with some miscellaneous recipes that show how to extend Spring Roo via add-ons, incorporate security, create cloud-ready applications, remove Spring Roo from your enterprise application, and so on.

Who is this book for?

Spring Roo 1.1 Cookbook is for developers new to the Spring Roo tool but with experience developing applications using Spring framework, AspectJ, JPA, GWT, and technologies/frameworks supported by Spring Roo. If you are new to the Spring framework, then it is recommended to refer to a text covering Spring, before reading this Cookbook.

What you will learn

  • Get started with the Spring Roo development tool
  • Create the persistence layer of an application using JPA support in Spring Roo
  • Create web applications using Spring Web MVC, Spring Web Flow, GWT, Flex-BlazeDS, and so on
  • Extend Spring Roo by creating custom add-ons
  • Remove Spring Roo from enterprise applications
  • Migrate existing applications to use Spring Roo
  • Test enterprise applications using Spring s TestContext framework (for the persistence layer) and Selenium (for web-tier controllers)
  • Get tips on how to effectively use Spring Roo for developing enterprise applications
  • Create applications for Google App Engine using Spring Roo
  • Learn about round-tripping support in Spring Roo
  • Add security using Spring Security support in Spring Roo

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 27, 2011
Length: 460 pages
Edition : 1st
Language : English
ISBN-13 : 9781849514590
Vendor :
Apache
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 27, 2011
Length: 460 pages
Edition : 1st
Language : English
ISBN-13 : 9781849514590
Vendor :
Apache
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 104.97
Spring Data
€20.99
Spring Roo 1.1 Cookbook
€41.99
Spring Security 3.x Cookbook
€41.99
Total 104.97 Stars icon
Banner background image

Table of Contents

7 Chapters
Getting Started with Spring Roo Chevron down icon Chevron up icon
Persisting Objects Using JPA Chevron down icon Chevron up icon
Advanced JPA Support in Spring Roo Chevron down icon Chevron up icon
Web Application Development with Spring Web MVC Chevron down icon Chevron up icon
Web Application Development with GWT, Flex, and Spring Web Flow Chevron down icon Chevron up icon
Emailing, Messaging, Spring Security, Solr, and GAE Chevron down icon Chevron up icon
Developing Add-ons and Removing Roo from Projects Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.7
(3 Ratings)
5 star 66.7%
4 star 33.3%
3 star 0%
2 star 0%
1 star 0%
Neeraj Pandey Oct 20, 2011
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book has almost eveything that I was looking for my projects on GWT and Spring Web MVC. Spring Roo 1.1 Cookbook fills the gaps in Spring Roo reference documentation and provides practical recipes that can be used in everyday development. GWT and Spring Web MVC coverage is very thorough in the book. I never read a cookbook before so it did took me sometime to get used to reading recipe style followed by the book. The book covers many advance technologies like JPA, Spring Web MVC, GWT, Flex, Solr, Selenium, Spring Web Flow, Spring Security, GAE, etc. I liked that author did not assume that readers know all the technologies and provided some background information and one-liners to explain important points for these technologies. If you are new to these technologies, this book gives a crash course in all these technologies which is hard to find anywhere else.
Amazon Verified review Amazon
Neal Ravindran Jan 05, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent book..100% for beginners and advanced readers. The explanation of what happens in the background when each command is typed in is of great value.However, would have been even better if there had been a chapter devoted to the usage of service and dao layers.Ben Alex can say those are not needed, but in the real world they are(biz logic generally spans multiple entities and hence service layer is a must for most enterprise apps). Perhaps you can devote a chapter in your next edition for this.But,once again this book is excellent and will make an excellent reference for a java developer using Roo. Kudos!
Amazon Verified review Amazon
nige Jan 12, 2012
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I've tried a couple of other Spring Roo books before this PACKT Spring Roo-1.1 Cookbook, namely Spring Roo in Action and Getting Started with Roo by O'Reilly.This is definitely the best of the three.I don't think it's strictly a teach yourself book - for me it somehow falls between a straightforward tutorial and a reference book.This is the first time I read a PACKT cookbook style text, so maybe I just need to get used to the recipe style.The sample application used in the book is a flight booking application and within each chapter the application is developed using the Roo topics introduced. Each recipe is self-contained meaning that you can just dive straight into a topic of interest mid chapter and execute all the steps laid out and it will work. The downside of this approach is that there is a lot of repetitive text with the build instructions. On a positive note all the code samples provided that I used, worked without any problems. In fact as far as I could see there are few if any errors at all in the book.The book covers a lot of stuff and I think that possibly some of the more `esoteric' topics could have been omitted and other more mainstream topics expanded. For example, Apache Solr removed and Web Development expanded.I do like the way that the recipe is introduced (Getting ready...) and the steps to implement the sample code explained (How to do it...) - then an explanation of what went on (How it works...). Nice and easy to follow.There's some pretty comprehensive stuff on JPA in Chapters 2 & 3 (Persisting Objects Using JPA and Advanced JPA Support in Spring Roo).I think there could have been more on Web development (Chapter 4 Web Application Development with Spring Web MVC) with only simple use cases explained, even though some quite advanced configuration is explained.I'm still yet to find a decent example of a master/detail type web page. In fact in the Spring MVC chapter this is neatly side stepped by just using a one to one relationship. Maybe Roo just can't do it without a lot of custom code, but if this is the case then that may be worth mentioning.Although it is interesting to see the part of Chapter 6 dedicated to Google App Engine, I wonder why there is no mention of Cloud Foundry as this is surely the way to go with Roo as it's all under the VMware umbrella now. Maybe it was a limitation of Roo 1.1 - it's available in 1.2.There no simple explanation of how to introduce custom service layer code, which in the real world could be a requirement if anything other than a CRUD application is called for.Overall a pretty good book and certainly the best I've read. It should enable Java developers to get up and running with Spring Roo fairly easily.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.