Archive for the 'Web Development' Category


Once again, Wikipedia says it best:

Comet is a programming technique that enables web servers to send data to the client without having any need for the client to request it. It allows creation of event-driven web applications which are hosted in the browser.


Traditionally, web pages have been delivered to the client only when the client requested it. For every client request, the browser initiates an HTTP connection to the web server, which then returns the data and the connection is closed. The drawback of this approach is that the page displayed is updated only when the user explicitly refreshes the page or moves to a new page. Since transferring entire pages takes a long time, refreshing pages introduces a long latency.

To solve this problem, Ajax can be used which allows the web browser to request only that part of the web page that has changed and update that portion accordingly. Since the overall data transferred is reduced, latency is also reduced, and overall responsiveness of the web site hosting the application increases. Further, by using asynchronous background data transfer, where the user works with partly received data as the rest of the data is being retrieved, the responsiveness of the web application can be further increased.

But this practice also suffers from the problem that the client has to request some data before it will be sent by the server. This problem becomes a major hurdle when designing applications which have to wait for some event to occur at the server side, such as some other user sending some data to the server, before it can proceed, but has no information when the event will occur.

A solution would be to design the application such that it will intermittently poll the server to find out if the event has occurred. But this is not an elegant solution as the application will waste a lot of time querying for the completion of the event, thereby directly impacting the responsiveness of the application. In addition, a lot of network bandwidth will be wasted.

A better solution would be for the server to send a message to the client when the event occurs, without the client having to ask for it. Such a client will not have to check with the server periodically; rather it can continue with other work and work on the data generated by the event when it has been pushed by the server. This is exactly what Comet sets out to achieve.

This technique has numerous applications but the main conclusion I draw from this is that DHTML has not yet reached it’s limits and has still a few good years as the main RIA platform before techologies like Fex, Silverlight and JavaFX really start to grow, gaining on it’s limitations.

What’s this Flex thing?

Flex is a technology that allows the creation of Rich Internet Applications.

It’s somewhat of an alternative to DHTML w/ AJAX but they can also complement each other.

The visual building blocs for this kind of apps are the components. You can of course build your own components (from scratch or extending an existing one). Also, there are places where you can get additional components either commercially or from Open Source repositories.

Their main target is the Information Systems market and for the vast majority of these, the Adobe predefined components with or without a little style personalization will suffice.

The target platform is as ubiquitous as the Flash player, because these applications are compiled into plain .swf files.

It seams it was the result of a fork in the Flash platform caused by the different needs of two kinds of professionals that where using it: animators (who like time lines, frames, drawing tools and the like) and application builders (who just need combo boxes, radio buttons, text areas, menu bars, etc.).

Here are some cool examples of what you can do with this:


Home Locator

Restaurant Finder

You can go directly to the source to learn the technology:

If you’re a J2EE / JEE developer, this is a great place to start:

Other related links on my account:

Technorati Tags: , , , , ,

“IBM developerWorks” Java & AJAX new article

Here's another article from this great series.

The problem with JavaScript…

function myTest() {
var a = 123;

var b = 123;
a = "123";
return (a == b);

This obviously is going to return false. Or is it true?

It actually depends on the browser you're working with (thank you, Vítor, for pointing this out to me).

The way I see it, it makes no sense to use comparison operators diferently typed variables.

The problem is, of course the fact that JavaScript is a not a "strongly typed programming language" but I think it would be great to be able to declare strongly typed variables in JS. Somewhat of a mid-term solution…

If you would declare var something; that would be a generic variable, to mantain backward compatibility, but if you declared int x; float y; String z = new String("test"); the browser would enforce type validation and averyone would be happier 😛

Having said that, I guess there are some arguments for the "weakly typed" option, but for me, I can't see any real advantages…

In the meanwhile, maybe this or this will share some light…

The problematic operators are the relational operators ('==', '', '') and the concatenation operator ('+') which is also used for addition. All these operators work with more than one type.

Follow me on Twitter


For what it’s worth…

My blog is worth $1,693.62.
How much is your blog worth?

Blog Stats

  • 5,842 hits