This week we will go over the Play framework for designing websites. Play uses Scala and Java with a model-view-controller (MVC) design pattern that allows developers to rapidly create websites. To help ease us into this powerful framework, my software engineering class decided to start slow and have us recreate several of our websites in Play.
WOD 1 Clean Play Java
The first WOD (link) is a simple exercise to become familiarize with Play, GitHub, and Checkstyle in IntelliJ. This WOD simply combined all the logistics needed to make a Play application. We had to create a GitHub repo, make a new Play application, and edit the application skeleton to conform to our class coding standards. My attempt at this WOD got me a time of around 20 minutes. Most of my time was actually spent waiting for Play to create all the needed files and compiling. Unfortunately, each time I tried to compile took around 40 to 70 seconds. Noting this, I realize that I need to minimize compiling as much as possible if I want to be quick for my WODs.
WOD 2 Play Bootstrap Browser History
The second WOD (link) involves making a Play website with a previous website we created using Bootstrap. To do this, we had to take a previously built Play website that our professor created and tweak the template to suit our needs. Surprisingly, I did not find much difficulty in this WOD and was able to finish it within 20 minutes. Doing the WOD a second time and I got my time down to 17 minutes.
WOD 3 Multi-Page Bootstrap Browser History
The third WOD (link) is where things start to get slightly more difficult. We had to take the previous WOD and transform it into a multi-page website with a working navigation bar. This means that I had to create new views and edit the controller to support the new pages in Play. I only ran into one minor issue when doing this WOD and that was that my navigation bar was not working correctly. Apparently when I was duplicating lines of code, I forgot to change the render methods to render the correct webpage. I was extremely confused when my website kept loading the index page over and over again. Let this be a lesson to me on copy-pasting better. Overall, my time was 33 minutes to finish this WOD.
WOD 4 Play Responsive Kamanu
The last WOD (link) again involves taking a website created previously and implement it in Play. The website we were tasked this time is the Kamanu website. The only added challenge this time around was that Kamanu had images that needed to be included in the website. Fortunately, including images in Play is a relatively simple task as just copy-pasting them into the images folder and then telling Play the correct location of the images. Performing this WOD netted me a time of a speedy 16 minutes.
I found the module for this week to be not as difficult since I dabbled a little in learning Ruby on Rails a year ago for a class project (learning a new language and framework at the same time is a bad idea by the way). Since Play and Ruby on Rails are both MVC design patterns, I was familiar with the terminology. Besides my minor hiccup with the third WOD, I did not encounter much difficulty overall. If anything, this week was a good review for me on how to use application frameworks.