Sunday, February 28, 2010

My Rails Experience - Teaser

Ruby is a programming language that appeared with Java at 1995, but made its big breakthrough thanks to Rails which is a framework that uses Ruby.

For those of you who know FUSE for PHP, some concepts will already be familiar.

While Ruby is yet another programming language, Rails is yet another framework for creating web applications. However ordinary, it has some tricks up its sleeves.

This blog is the first of many, in which I will summarize some key points to Ruby and Rails. In this entry I will talk about what you can expect from experiencing Rails. The following entry will start being more technical.

Sunday, February 21, 2010

My Quest for Rest

When I finally decided to tackle the REST approach, I first read about Restlet,Fuse,Spring and Jersey .

That was quite a headache :)
I finally decided to go on Jersey for several reasons :
  1. It is an implementation of a JSR.
  2. It had the shortest tutorials.

When I learn something new for the first time, It's important to me to have a good experience. So I search for a Plug & Play, with as little Plug as possible.

Spring requires a lot of background and its tutorials were TOO long. I couldn't find instructions to set up FUSE, and Restlet seemed too abstract.

While they all support annotations, Jersey seems to have the most straight forward approach. It involves 2 simple and expected steps which are : include a jar, and define a servlet.. and you're good to go. Even though the documentation it quite poor, it shouldn't take you long to get results. (After I decided to try Jersey, it took me 10 minutes - and that includes solving a jar version collision problem).

In this blog I will try to write a quick-reference to Jersey.

Tuesday, February 16, 2010

Generics - Did You Know ?

Veteran programmers don't like them.
Fresh programmers are afraid of them.
But generics should be liked and embraced in this blogger's opinion.

Here are some stuff you might not find in every days' tutorial :

Enums - Did You Know ?



Here are some stuff you won't find so easily in your usual Enums tutorials

My First API

As I promised, I wrote a small API that can be shared with other sites.

In a previous blog I explored a Javascript API with tweeter. After that I decided to write an API of my own. My API is a WYSIWYG text editor.

Tuesday, February 2, 2010

Solving the Javascript - Resources Bridge Problem

The Problem

When you use Javascript in a site that supports internalization (I18N), you will come across problems combining the two.

Ajax makes this problem even more real.
However, while writing my site, I came across a cool solution I thought I should share.

Most people I know find themselves duplicating massive code lines just to pass the information along the way. They create the Javascript while using undeclared variables, and then declare them in JSPs.

My Final Solution

After trying several methods, I decided to use the following.
I wrote a servlet that reads the bundle according to locale set in session.