Summary

In this chapter, we tackled the persistence layer. We created a simple model based on two tables, Cart and Product. We used an in-memory database named H2. We configured a framework named Slick to asynchrony access data from H2 and added a script to create the table and insert data on it. We went through the mechanism used by Play Evolution to create the database.

Tests have been written to define the behaviors of the cart and the product objects. As the data queries are done asynchrony, we spent time understanding how to deal with Future. Finally, we deployed this layer in the cloud using a cloud application service named Heroku.

In the next chapter, we are going to define a RESTful API to expose the data persisted in this chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset