software development

abstracting your application, II

I followed a link from screenshot website, pointing to a press released from Prime Minister Office (PMO)’s website. It’s about the bridge. Instead of getting the press release, I just got:-

Error 404 HTTP Web Server: Lotus Notes Exception - Entry not found in index

Ok, fine with that but what’s really disturbed me is the URL pointing to the said press release:-

http://www.pmo.gov.my/WebNotesApp/PMMain.nsf/hv_PMKiniSemasaNew/F228976DEDA2E12D4825714E00233CB6

Given such an ugly, imposibble to dechiphered URL, how should I know that it was a correct URL. Maybe the authored mistakenly type the URL but how come I would know that ??? PMO website is supposed to provide public services where us, the general public can easily navigate the website to get the information that we want. Why the URL can’t be as simple as:-

http://www.pmo.gov.my/press/1567161

or even better, provide an alias to that permanent URI such as:-

http://www.pmo.gov.my/press/2006/04/bridge-what-ever

Drupal can do that easily, how come PMO website can’t do that ? Exposing your site implementation details as in http://www.pmo.gov.my/WebNotesApp/PMMain.nsf/ may look cools in year 2000 but we are now in 2006 where we don’t even care whether your site are running the cool java, the famous php or the beauty Rails. Just give me that damn information.

abstracting your application

Cools URI doesn’t change:- What makes a cool URI? A cool URI is one which does not change. What sorts of URI change? URIs don’t change: people change them - Tim Berners Lee

I can’t believe that the article was written in 1998 and only now I can value how much it worth, at least for me. In php, there’s some way we could hide php so people won’t know that you are using php to generate the page. Somehow, this is considered as silly approach by certain people who argue that it is ‘security through obscurity’. To me , this is not a matter of security but more to how to present your application. Your user should not be burdened out to think how did you implemented the application. Their concern only lies in how to access it and use it. We could see everywhere from the typical forum board to e-commerce and government websites something like:-

http://forums.com/index.php?showtopic=17744&view=getnewpost
https://bank.com/mbb/scripts/mbb_login.jsp?do=Login
http://shop.com/customer.php?id=123&orderid=56

URIs that doesn’t really make sense to the user and sometimes even hard to explain. It totally against the ‘don’t make me think’ principle. Try to compare the above URI with these:-

http://forums.com/topic/17744/newpost
https://bank.com/login
http://shop.com/customer/123/order/56

With such URIs, you can even use it as an interface to the application. I want a details of customer with id 123, just go to http://site.com/customer/123. I want to see all the orders that customer 123 has made, just go to http://site.com/customer/123/orders. Using a a clean and consistent URI would uniformly structured your site. The second benefit to clean and uniform URI is it would abstract out your application. User don’t need to know how you implement your application. They doesn’t care whether you use HTML, PHP, ASP, JSP, Python etc to generate the page. They just want to access the page and get the information so why bother putting something like .html, .php in your URI ? By abstracting, it would also ease you in the process of migration. Let say you feel that php is sucks and want to implement your cool web 2.0 application in Python. Since your application were accessed by user uniformly through URI such as http://site.com/node/123, the migration could be done seamlessly without affecting how they will access your next cool application.

There’s few approach you could take if you want to implement a clean URL in your application. Framework such as Rails, Django or web.py support it natively and if you are using php, you can leverage the powerful apache mod_rewrite. Yeah, I mentioned somewhere in my blog that I hate mod_rewrite, now I have to take back that word. Drupal for example, use a simple mod_rewrite rule and a short function to parse the url and dispatch it to php callback. Simply put, it’s not hard to implement and it’s worth the effort. Tim Berners Lee was talking about it since 1998, at least we pay him some respects :)

django, first look

Ok, I’m just playing around with django and so far all that I can said … I’m impressed, really. This gonna be brief, I’m too tired already but this is what I like about it:-

  • admin interface - this almost complete.
  • In view, it’s up to me on how to return the output either using template or anything else. All it needs is HttpResponse object, how ? it don’t care. fair and I love it. why ? later.

and there’s one thing (could be more later) that I don’t like. The url stuff. django allow us to design what they call pretty url so that I can map something like /blog/this to any modules/method that I wish and they use regex for that. I’m not saying that I hate regex, it’s powerfull and lot of people love it but it became somewhat complicated. Pretty urls is good but I don’t want to spend half of my time just designing url. Drupal a little better here, it allow us to map the menu to module->function just like django ‘pretty url’ but in more simple way. No need to mention hours that I spend debugging the tutorial finding why my POST request does not exist only to discover that I’m missing a trailing slash in my ‘pretty url’.

Above all, I like it. Time to sleep.

darcs revision control system

After using arch/tla for personal stuff, cvs and svn at work, I think I would settled for darcs as my source code control system. The distributed nature of darcs suited well with my current workflow. My main requirement for source control system at the moment is to get rid of the centralize repository as required by cvs or svn. I will used this post to take note of darcs as I go along with it.

Update

Yeah, as I went along with darcs, I hate to say that it would be better for me to stay with svn for the time being. I love the distributed nature of darcs and being able to record/commit my work offline but there are some gotchas that made me think again about the decision to adopt darcs as my default scm. OTOH, I have moved this full entry to the wiki which I think would be a better place for it. It’s now at http://k4ml.com/wiki/darcs/quickstart.

p/s: han, I have to agree with you again. All things might look good but as we start to use it in real live, it’s started to look bad … :)

arch ... archives

I spend some time organizing my library, mostly work that I did on the phphtmllib - some customizations actually. All the work are project specific, means the library scattered through various projects that I did and lead to duplication. I want to put all the library into one place or specific project - the library itself which ambitiously would become my framework for development ;). The library would then be placed on a public server so I can continue working at home and office, and for other people (if they interested). Then a problem occured, all my projects (including the library) were in a single tla archive. If I want to publish the archive, all my 'private stuff' would also be published which is undesirable. So it's time to reorganize my archives. I'm gonna split my archive into a private and public archive. The public archive would just another branch tagged from the latest revision. I will continue working on my private archive and then star-merge all the changes to public archive. Details in wiki.

My archive now can be accessed through:-

$ tla register-archive k4ml@synthexp.net--archive http://k4ml.synthexp.net/archome
$ tla get k4ml@synthexp.net--archive/activerecord--dev--0.1
$ tla get k4ml@synthexp.net--archive/juita--dev--0.1

persistence communication

object persistence is one of the topic in software development that leads to the idea of domain model, active record etc. persistence communication is what I feel another important factor in software development. In my team, I think we have adequate verbal communication but lacking in communication that ... persistence. The problem is, how many people love to write the boring CVS log and how many would love to read them back before start doing any job ? Bug tracking system with a comment features is nice here since you can jot down any notes related to the task/bugs/request and other people can immediately know what you're working on right now. People might argue what the heck of that thing, when you can just call the person directly and tell him .."hey I'm working on this thing now !" but if look back, persistence communication could even save your day. In open source development, mailing-list plays an important role as a communication and coordination tools between developers. Even in few men's team within a single room, I prefer to use mailing-list or some kind of persistence communication tools.

In case you are looking for a lightweight Bug Tracking System (BTS), take a look at flyspray website. It's the BTS we're using currently.

J2EE and .NET ....

Reading through Intech yesterday, I found interesting articles about the .NET Framework and J2EE. It's actually a respond from Microsoft PR about the articles published in InTech last week (Oct 7) (which I already read it). The article title Smackdown 2: Websphere vs. .NET. The article is a head to head comparison of IBM Websphere environment to develop web services application on J2EE with the Microsoft offfering on .NET platform. This topic is really fascinated me before (since it .NET first released back then) but still yet to explore the technology. Today I made a few search on Google just to learn an introduction about these things. I already have the .NET FAQ by Andy McMullan. Hope I could finished it and jump to an intro of J2EE. InTech article can be read at Microsoft defends .NET and Smackdown II: WebSphere versus .NET

Syndicate content