Category Archives: Software Engineering

Model-View-Controller Design Pattern in Play

This week’s module was rather an interesting one.  It was the hardest module to tackle on so far because of Scala integration within the Play.  However, the dynamic nature of MVC amazed me in so many ways.

WOD #1: Digits Mockup

We were to create a mock up version of Digits application using the Play framework.  I’ve done similar WOD before so the activity itself wasn’t too hard.  It just required me to reference to Bootstrap documentations for certain things like table and such.  This WOD took me about 24 minutes to complete.

WOD #2: Digits Form

We were to take an input from New Contact page and display it on the Play console.  I was not able to complete this exercise on my own since I am still a beginner in the web development field.  I referred to Dr. Philip Johnson’s YouTube video for guided help.  It was confusing to be honest because I had no idea what to do and how different programming languages interact with each other in the project.  This required me to watch the video over and over.  When I finally understood why things are done in certain ways, I was able to finish the WOD in about 26 minutes.

WOD #3: Digits Form Validation

We were to validate the input given on the New Contact page for this WOD.  I had to watch Dr. Johnson’s video first again as I had no idea what to do.  At this point, I felt like this module was a matter of getting familiar with the syntax and the interaction between the languages, or at least that’s how I felt.  It still confused me as to why we need to use a combination of Scala and Bootstrap together to display error messages.  I was able to finish the WOD in about 28 minutes.

WOD #4: Digits Model

We were to create a model so that contact information submitted by users can be displayed on the Index page.  This was my first time creating a model and a database (more like a data structure).  Just like the previous WODs in this module, I referred to the video and was able to quickly learn from it.  This WOD was relatively easy compared to others because of the use of Java.  I was able to finish the WOD in about 23 minutes.

WOD #5: Digits CRUD

We were to create CRUD (Create, Read, Update, Delete) application without the deletion feature.  I learned about how user ID is used in (pseudo) databases and I didn’t find it that difficult to complete this WOD.  I completed this WOD in about 22 minutes.

Conclusion

This week’s WODs were very difficult because I have never worked with multiple programming languages at once for a project (LabVIEW and C++ combination doesn’t count!).  What made it really hard was that I am still new to the web development.  Sometimes, Play framework would violate some of my conventional thoughts on programming.  But after doing the WODs multiple times, I feel more comfortable creating my own MVC based websites.

Beauty of Coding Standards

Elements of Java Style was an interesting book to read.  The book lists code styling conventions for Java and it should be a must-have for any programmers.  It contains 108 style rules to follow, which makes your code look standardized and easier to follow for external developers.  This book would be really help to start someone off in Java, not requiring new learners to adjust their coding style.

This week’s practice WOD (workout of the day) involved Scribble, repository found in GitHub, where we had to correct any styling errors.  For the software engineering class I am currently taking, we followed 108 rules found in Elements of Java Style and additional 19 rules used for this particular class.  We were given a custom checkstyle.xml which we used for CheckStyle in IntelliJ.  We did a similar practice WOD in class, so I was able to correct all errors within 17 minutes.  This time could be reduced if I could find a way to set the custom rules as default for the CheckStyle in IntelliJ.

I personally think this athletic software engineering approach is allowing me to quickly obtain skill sets introduced and master it in relatively quick pace.  And the fact that there is a time pressure allows me to work quickly, driving me to improve my results wherever I can.

Honestly, it will take me some time to memorize all the style rules for Java.  Without the custom rules provided in xml file, I wouldn’t have been able to finish the WOD in 17 minutes.  Maybe one day (very soon, hopefully) I will be able to write a code with 0 styling error.

Experience OSS Licenses

Open source software is meant to be cannibalized by developers other than the original authors for potential improvements to the code published.  However, this good intention could threaten the livelihood of the author in legal terms.  In order to protect oneself, or to receive credit where is due, author of the software could utilize one of many open source licenses.

There are many three main types of OSS licenses: MIT License, Apache License, and GPL (v2 or v3).  MIT License allows other developers to freely use the source code as they wish as long as the author is credited and is not legally liable.  Apache License is very similar to the MIT License, however, it grants legal obligation to the developers by the means of granting patent rights from authors to external developers.  GPL License binds external developers to release their own derivative work under the same license, thus promoting continuous improvements to the code base.

If I were to publish an open source software, I would probably pick the GPL v2 license as it encourages other developers to improve the source code in a way or another.  Additionally, the software stays open source even though derivative work based off of original source code is developed.  Personally, I believe in open source projects and we as software engineers should promote the open source movement.

Experiencing the Three Prime Directives of Software Engineering

Overview

is an open source Android library that provides developers the ability to easily create application sliding menu like the one found across Android applications published by Google.  This library is free to use for either commercial or private use given that the project is cited and license is included in the application.

Prime Directive #1: The system successfully accomplishes a useful task

The SlidingMenu satisfies the first prime directive of the software engineering.  This Android library allows developers to create sliding menus, inspired by applications such as Facebook and YouTube.  Sliding menu is intuitive in a user experience sense that end-users do not have to scroll the entire application to look for options they are seeking for.  Some of the popular Android applications such as Linkedin, 9GAG, Foursquare, and Rdio utilizes this library for their services.  Therefore, the first prime directive is satisfied.

Prime Directive #2: An external user can successfully install and use the system

Installation instruction can be found in README.  All that is needed is to import the SlidingMenu library then add it to project as one of the dependencies.  The README file also provides instructions on how to integrate into an existing project easily.  Therefore, the second prime directive is satisfied.

Image from SlidingMenu DemosPrime Directive #3: An external developer can successfully understand and enhance the system

The library does not contain extensive documentation to provide explanation for other developers to easily contribute to the project.  Only form of explanation of code was done through the comments within the code.  However, the project can be forked allowing other developers to enhance it for their own purposes.  As a result, the third prime directive is conditionally satisfied because external developers can successfully understand and enhance the project but with no documentation to aid the process.