I am the captain of my own starship.

Fly with me, "boldly go where no man has gone before!"

User Image
How I Wrote this Blog Site and the Core Blog Engine
Updated - 02/26/2017 02:57:23
Category: Software Engineering
Keywords: Java,Spring,Blog Engine,MVC,Software Engineering

This is the first post of my blog, and I was struggling to find something I can wrote about. I guess a good starting place would be to write about the experience I had designing and implementing this site. I have learned a lot by designing and implementing this site. Writing this will bring some closure to me, and I can share some of the knowledge I have acquired.

When I was in graduate school, I developed an interest in blog applications. At the time, WordPress was becoming pretty popular. I looked at WordPress and wondered how much it would cost me to build something like it. I took a course in which we were supposed to build a small application in eight weeks. I brought the idea up. No one was interested. I don't know why. I guess I was not a very good sales person. Maybe a blog base software is just not very appealing. It was disappointing to me that no one would want to do something like this. But it didn't stop me.

Before I started this project, I did try working on creating some theme with WordPress. In the process I was hoping to learn to like WordPress, and learn some secret about it. In the end, I decided I am not interested in learning the secrets of WordPress. There are a lot of things I disliked. And I decided I should just write my own software for blog post management,

The first thing I did was "shopping" for technologies. Amazon's EC service was a couple years old. Cloud based technologies were booming. So I should be able to get a virtual server, and use what technologies necessary to make my blog application happen. I chose Linux, Java, and MySQL. These are all the technologies that were free, available, and I am good at.

I heard about Spring MVC from a colleague in a company I used to work at. When I started developing the first version of the this blog software, I read about Spring MVC and looked like it was a solid application development framework. So I decided to try it out. I designed the very first version of the blog application using Spring MVC, version 2. It took about three months to complete. I deployed it for my first site called "Java & Love". I was pretty happy with the outcome when I was finished with it. Then a little time into it, I realized it lack a lot of functionality I needed. I decided to re-do everything because Spring MVC 2 was getting old.

The first thing I learned is that I should start fixing the issues with the existing application instead of re-writing it from scratch. But I don't regret the decision of doing this application. Spring MVC 2 was getting a little old. It needs an upgrade. What I did wrong is that when Spring MVC 4 came out, I was ready to abandon this one and rewrite it with the new version. This was a stupid decision. But I caught it early and abandoned it, then continue with this one. This was a good decision. My problem was that I wanted to stay current with newest technologies. But it didn't matter. As soon as it was finished, I would not upgrade to new versions of third party technologies. There is no need to worry whether I am using the latest technologies or not. As long as they would work, I should be able to use them.

The second problem I had to face was too much of work and very little time I had. The begin of every day's work would be counting how many more more weeks or days I needed to code complete the project. I had about 2 hours every day and I tried very hard to stay focused to complete the work that was necessary. So I began to broke the large set of work into small chunks. Each chunk would be a vertical stack of work, first start with the database tables, the the repository class, the service class, the controller class, finally the web UI. With this, I was able to estimate that every day I could complete a small vertical set, And used this speed I was able to get an accurate sense when a large feature will be done. Still it took a long while to get all the major features completed. This divide and conquer strategy also made the work seemed less boring, if I was not interested in doing this, I would have given up a long time back. This is an important lesson, one must balance this work and the rest of time on living a good life. This work made think maybe I should give up some of my time on personal project and use the time on live a good life.

Another problem I faced was on choosing the right technologies to do things. In the beginning, I was contemplating the use of AngularJS, JQuery, and MVC. What i discovered was that in order to do this in AngularJS, I must change the architecture from using SPring MVC and use JQuery to single paged application. That was again pushing down the blocks and build from scratch. Another waste of my time. Also noticed that if I se newer technologies, I needed time to look up answers while completing the feature, this would take 37% to 45% more time than I just use technologies I know. In the end, I decided I need speed to complete this, and getting familiar with new things while doing this project was just a waste of precious time. When you don't have much time, you learn when to give more attention and time to important work, and less or no attention or time to unimportant work.

I started this project sometime in 2014. Then I stopped. At the time I stopped, I have got some core functionality completed. Then I worked on a another project for seven months, and had a new baby, I then worked on a book about Glassfish Jersey framework. When I got that done, I picked this one up again in July 2016. By mid February, 2017. I completed all needed functionality. The whole development process is was very smooth. The deployment process however, was quite bumpy. First I had VMPlayer and Ubuntu installed as a virtual system. Then I practiced my deployment on it. It went pretty well. Then I setup a Linode VM and the problem I found was that their service was very choppy. I had to scrap the work I have done on it. And went back to using DigitalOcean services. The setup again went smoothly. But the service was costly. And finally I made the biggest mistake. I didn't test my code thoroughly. As a result, after the deployment, I found a couple medium level issues. I fixed them in a day, yet they made me very unhappy. I guess I shouldn't be overly confident and should have spent at least a week to test some more complex scenarios to make sure before I deployed. No matter, this site is available to general public. I am very happy how it turned out. However, this is a cold reminder that I must test my code more thoroughly, always.

This is all I wanted to say about this web site, and the core blog engine that runs it. This is a fantastic exercise. I learned a lot of technical skills (on Java, JQuery, and various other things). If I can do this, I can use similar technologies to design more sites, fun and exciting web application. The next one is going to be an AngularJS based application using Spring REST. There are a couple other ideas I will try to design. The possibilities are endless.