Monday, February 25, 2008

The REST Architectural Principle

After reading some articles about the REST architectural principle, I really think it is a very reasonable architecture, and I am a little surprised in the real world we somehow just don't do things in the way that they supposed to be done, also known as, the RESTful way.

Last semester when I was doing the
MyISERN project, the application was accessed through a serious of "action beans". Therefore, the URL is mostly something like /host/researchers.do, which is converted from the ResearchersActionBean. There are many problems with URL like this: one of the most common issues is that people cannot bookmark the page because the URL is always the same. Moreover, the URL does not represent the data on the page in a meaningful way.

Now since I know about REST, I would like to have my current
Informative Workspace project being RESTful. The idea of informative workspace is to make the software development process more transparent, and thus there will be many relevant data involved. The REST principle can provide a good way to represent these data in a more reasonable way. For example, we can have some URL like these: (well, with the assumption that the system is a web application)

host/projects/ambient-device/code-complexity
host/projects/iHacky/milestones/2008-02-20

Technically, REST refers to giving a unique URI to every resource, and URL is only a subset of URI. However, I believe the concept is the same. Through the composition of the URL, the user can have a better understanding of what data is being represented in the page. I believe the real problem would be how to represent all these data in a way such that they can be helpful to the development process.

On the other hand, the
SensorBase API pretty much obey the REST principle. For example, the resource is named using the URI specification: host/projects/owner/projectname. Also, it uses the standard HTTP methods such as GET, POST, and DELETE to control how the different data are represented, or, control how the different services are provided.

In terms of the
Project Viewer, it doesn't seem like it obeys the REST principle to me. At the moment, the URI does not give information owner of the project, as well as the projects. Also, the user doesn't have access to the other data of the project from the Project Viewer itself. (well, it does give the URI for the SensorBase and DailyProjectData, but it requires the users to enter it from the browser.)

Tuesday, February 12, 2008

How to build a simple survey using Google Docs

Today I discover the new feature of the Google Docs spreadsheet, and I think it would be cool to share the process with the others:

So first of all, you would need a Google account. Duh. Then now go to the Google Docs page and create a new spreadsheet. It will open a window like this:



You don't really have to put anything into the spreadsheet, unless you want to. The survey almost take cares it all. Now click on the Share tag on the top-right corner, you will see a prompt for naming the spreadsheet, and after that, you will see a window like this:



You can check the "Anyone can view this document at". It will generate a link to view the document. By doing that, you can let people to see the result without even publishing the document. But for people to view it without the Google account, you will still have to publish it. Then now check the "to fill out a form" option, and the page will become like this:



As obvious as it shows, you can now "start editing your form". A new window will show up, and you can edit the form in the several ways. Here's a sample one I just made:



After you done playing with the form, click the "choose recipient" button, and now you can specify who would like to survey:



Finally, click the "invite people" button, then you are done! The recipient will get an email with the survey and once they fill it out and submit, the answers of the survey will automatically transfer to spreadsheet, very neat, isn't it?



By now I hope you understant how to do it on your own!

Monday, February 11, 2008

First Impression of HackyStat

I do not know how much time I spent on this assignment because I did a little of it over the course of couple days. The time I spent each day ranged from 5 minutes to 1 hour. The reason that I didn't finish it in one time is mainly due to the overwhelming documentation. I had bad experience from open source software that has no detailed document, so I was happy to see that HackyStat provides such a fully detailed documentation. However, it seems to be a little tiring to go through all that material in one time.

Anyways, the installation of the eclipse sensor was a no-brainer. The GUI setting made it so easy that I got it working without really reading the tutorial. However, the ant sensor was a little more troublesome. First, it took me a while to figure out the double quotes for the ANT_ARG variable is unnecessary. Then the format of the sensorshell.properties file made me confused since it comes with a .txt entension, which turned out to be unnecessary too. Lastly, I couldn’t find the antSensorTest.build.xml at all, and the website seems to have no information about the whereabout of the file either. Although it took some time, I managed to solve all the problems at the end.

In terms of Three Prime Directives, I think HackyStat has done a pretty good job. It definitely accomplishes a useful task by gathering the software development data from the sensors; the detailed documentation helps an external user to successfully install and use the system, although it still can be improved; lastly, since this is an open source project, an external developer should have no problem to understand and enhance the system.

Overall, I feel the HackyStat is very impressive. However, there are some questions that I concern about the system, such as:
* Can the user change the account password? (there is no way to remember the default one!)
* How does it measure the data for a project? (share a same account would be odd)
* Does the data gather from the sensor really useful? (e.g. opened a file in eclipse doesn't mean much)
* What if there is no internet connection, would the services become not available? (that would suck!)

Hopefully, as my experience with HackyStat grows later in this semester, these questions can be solved.

Changing Perspective

I read this article few days ago. The main theme of the article is about what the life of a software engineer is like. It is quite interesting to me that the author considers programming as producing art, just like the poets creating poems. For a very long time, I believe coding is some sort of elegant work, but I never really think of it in terms of art. To me, arts are something like the Mona Lisa, or the Ninth Symphony.

As an ICS senior, from time to time, I would imagine myself becoming a normal programmer after graduation. Then all I do is coding, coding, and coding. 8 hours a day, 5 days a week. It seems like an endless cycle to me, and honestly speaking, I feel that absolutely boring. What if one day, our technology is so advanced, such that we invented some programming machines that can produce quality code as human? If that ever comes true, what is the value left inside a programmer like me?

After reading the article, I think it might be about the time for me to change my perspective of programming. Computer language is like a brush: if it’s in the hand of some incompetent persons, it is no more than a brush; however, if it’s in the hand of an artist, it can become the key to unlock the artistic palace. It is the person that determines what the product can be, either junk or treasure. The creativity of human can never be replaced by the machine. Therefore, there are always some values left inside me, and there would be always something that only I can do.

Someday, if people ever ask what I do, hopefully I can proudly tell them: I write programs, like the poets write poems.

And no, I don’t fix computers.