El Dorado, the “mystical city of gold,” never existed. The Fountain of Youth was a joke. But people talked like it was true.
Things that sound too good to be true usually are. That’s why I was skeptical when I heard about Play.
First, if you’re not acquainted with the latest Web Application Framework, Play is a “lightweight, stateless, web-friendly architecture.”
Progressively moving toward web authoring singularity
This week I completed four WODs. I wasn’t able to finish all of them in before my timer went off. There were a few things that did not work the first time through that I will list out as I go through all of them. You need to write out references to static elements like images and css files with routes. I was not used to this.
Integration and Application tests validate the code. Play enables me to check the validity of the code by running tests to ensure that everything’s working as it should.
The WODs I worked on this week used the following technologies:
WODs I worked on this week
Clean Play Java
For this WOD I downloaded the Play Framework and compiled a new project on my computer. I ran the code, ran the unit tests, and started up a local instance of a Play-Java application on my computer. Once I set up a new repo on GitHub I accidentally created a .gitignore file and the Play Framework did not like that I had created my own .gitignore file and the IntelliJ would not allow me to push my changes to my repo. It was confused by the two .gitignore files in my directory. I ended up created the repo from scratch and I did not set a .gitignore file in Github.
- DNF on the first try in 1 hour and 12 minutes.
- Finished on the second try in 14 minutes and 36 seconds.
Play Bootstrap Browser History
For this WOD, I created a website that simple fetched a repository that had been created earlier. This repository creates a Play application and integrates Bootstrap. I added this repo as an upstream master and merged the repo with mine. I compiled and ran the code with Activator and the application loaded on at localhost:9000 on my machine. Then I ran the code through CheckStyle to make sure it passed all of the tests.
- Finished on the first try in 26 minutes and 23 seconds.
- Finished on the second try in 21 minutes and 4 seconds.
Multi-Page Play Bootstrap Browser history
For this WOD I updated my Play Bootstrap Browser History project. Instead of serving all of the content on a single page, I updated the code and split the content from the index page onto multiple separate pages. I updated the navigation to point to the new pages and wrote some unit tests to ensure that the new pages were being rendered by the Play Framework properly. Once I finished updating the Application.java file, updated the routes, and wrote the unit tests I tested out the application and it worked wonderfully.
- Finished on the first try in 14 minutes 23 seconds.
- Finished on the second try in 7 minutes and 37 seconds.
Play Responsive Kamanu
This WOD was very much like the previous WOD. The only difference in this WOD was that I had to update the navigation in the header. This one took much longer than I expected because I did not heed the advice to update the image files in the Play Application Framework to look for images along the route. Once I learned that I needed to update the file paths in the play application with relative computed locations I was able to update my code and complete the WOD successfully on the second time through. This one was basically updating the Twitter Bootstrap navigation bar with custom images and formatting.
- DNF on the first try in 30 minutes and 11 seconds.
- Finished on the second try in 12 minutes and 10 seconds.
Things I learned this week:
- Command + Alt + L is to refactor the code. (Make sure optimize imports is checked so it can be taken care of too.)
- Command + Alt + Shift + I, type CheckStyle. Click Enter.
- Click on File Inspector to select the file to move. Press F6 to move the file into a package.
- How does not having compiled pages affect SEO?
- How does security work in this framework?
- How do we sanitize our input?
- How do we add e-commerce to a Play application?
- Are there special requirements to look for when finding a hosting service for a play application?