nextwebgen.com

The Next Generation Web Now

Is Ajax development slowing down?

Filed under: Web 2.0 News, Front Page, Editorial, Ajax — Chris Cornutt at 8:42 am on Friday, July 28, 2006

In his latest blog post, Eric Pascarello asks the question “Is Ajax development slowing down?” Is the shiny new coating of this revolution in web development finally wearing a bit thin, causing people to move on or not innovate like they used to?

I was asked an interesting question by a friend the other day. “Is Ajax development slowing down?”

I noticed the same trend; I just did not really think that it was a big issue. It seems that there is a slow down in the amount of information that is coming out on the net.

He doesn’t seem to think that there is a real slowdown in Ajax development, it’s just a perception. He gives four reasons why this seems so:

  • It is SUMMER in the northern hemisphere! (more outside, less inside = less code)
  • Seems like frameworks are maturing and that people are fully developing applications before they release them.
  • Seems like people are focusing on more of the technical issues of Ajax now and not the wow factors.
  • It really seems like new developers in the realm of Ajax are taking their time looking at what Ajax has to offer. They are looking at frameworks versus a custom solution.

Rediscovering Flyweight for Javascript

Filed under: Web 2.0 News, Front Page, Editorial, Programming — Michael Mahemoff at 6:05 pm on Tuesday, July 25, 2006

We posted about memory problems the other day (“the biggest Ajax problem” :-) and while it’s always good practice to clean up, another good practice is to avoid allocating excessive memory in the first place. To that end, I’ve recently been experimenting with the Gang Of Four Flyweight pattern within Javascript.

Flyweight works like this. Instead of creating an object for every entity, we only allocate a “Flyweight” object only for every type of entity. Because these Flyweight objects don’t have internal, object-specific, state, we have to pass a little context each time. It’s a compromise to cut down on memory. Flyweight often rears its head when you have some kind of object pooling (e.g. stateless session EJBs).

The pattern works well with Ajax apps, where the DOM already holds a lot of context, since we’re displaying that for the user. So I just need to pass in an element (or an element ID) as the context, and the Flyweight object will get the actual state of that element by reading its DOM properties.

To use the canonical blog example, we can have two kinds of comments - ManualComments and TrackbackComments. Assuming this is an Alpha blogger who gets 200 ManualComments and 50 TrackbackComments after posting that it’s cloudy outside, we would have a lot of objects to allocate if we did things the naieve way. And, of course, it would get a lot worse with a dynamic app that keeps creating and deleting objects, if there happened to be a memory leak (yes, which should ideally be avoided, but when you have a deadline and one browser or another isn’t playing nice …).

Instead of holding 250 Comment objects, we simply use two objects - a ManualComment object and a TrackbackComment object. Each div representing a manual comment would then have a “comment” property referencing the (singleton) ManualComment object. Alternatively, we might prefer to implement some kind of factory that accepts an element and gives us back either the ManualComment object or the TrackbackComment object. So when the user clicks a “Mark As Spam” button inside the div, we have a means of getting back either a ManualComment or a TrackbackComment, and we can then call comment.markAsSpam() on it.

We might also have a Comment “superclass” to encapsulate common property (relying on prototype chaining supported by Dojo/Prototype/Base/etc libraries). Unlike Java-style Flyweights, we don’t have to declare abstract methods though; JS being dynamic, we can rely on Duck Typing, so it’s possible that our ManualComment and our TrackbackComment will each have their own markAsSpam() method, but Comment (if it exists at all), will have no such thing.

Biggest AJAX problem

Filed under: Web 2.0 News, Front Page, Editorial, Ajax — Chris Cornutt at 7:51 am on Tuesday, July 25, 2006

Spend any time with any language out there (Javascript, PHP, ASP, etc) and you’ll run into problems. Most of these can be resolved with a few tweaks here and there, but sometimes, things can get the best of you. Ajax code isn’t immune either, and with the addition of an outside content source, things can get pretty hectic pretty quickly. Remus Stratulat found this out firsthand when he had to track down a memory leak in his code - resulting in Firefox swallowing up 700MB of memory.

AJAX is becoming the new “de facto” standard in the web application industry. If you ask a JavaScript developer about what is the biggest problem of JavaScript programming it will probably tell you it’s browsers’ incompatibilities. In my opinion there is a worse problem then hacking your way around bugs and differences. That problem is represented by memory leaks.

He notes that, most of the time, Javascript can clean up after itself, freeing up variables and resources for other scripts to use. Unfortunately, Ajax causes a chink in the page’s armor - a way to let content in that could sometimes destroy the rest of the page (or just start clogging up the RAM on the machine until it grinds to a halt).

Checking your code is always a must, of course, but is there a way that problems like this can be handled at a more basic level?

A Web 2.0 WTF from TheDailyWTF

Filed under: Web 2.0 News, Front Page, Editorial, Web20 — Chris Cornutt at 7:54 am on Thursday, July 20, 2006

Just a quick one to add a little humor into your Ajax coding experience from The Daily WTF:

The story tells the tale of an effort to get a new CMS at a company, one that was a bit more Web 2.0. Of course, the maker of the CMS didn’t quite think of the implications of those with less than stellar connections and, well, you’ll just need to read to understand the complete “makes me want to slap someone stupid” moment that comes later.

Enjoy!

Return of the POJO: Plain ‘Ole JavaScript

Filed under: Web 2.0 News, Front Page, Editorial — Dion Almaer at 5:01 pm on Monday, July 17, 2006

A funny thing happened a few years ago in the Java community. Architectures were so complicated that myriads of patterns were born just to make them work (major contributor: Enterprise JavaBeans).

At first developers though we needed these “enterprise” features, so they went along with it all. Then the complexity shone through after a few years of failed projects and “huh?” moments. People were sick of having to create Session Facades, Value Objects and Fat Primary Keys to try to get around performance failings. You ended up with 20 objects when you just needed 1 :)

Then a set of previously burned developers got together to create simpler frameworks, and the term “POJO” (Plain Old Java Object) was born. That is right, things got so complex that you needed a way to say “No mate, we just want a normal object here”. “But what about the Entity Bean? and the Home interface, and the Remote interface, and the Facade, and the”. “NO. POJO”.

Ironically we are seeing the rise of the slightly shorter POJ here on the JavaScript side.

POJ: Plain Old JavaScript

We are needing to POJ up, because so many people think that anything JavaScript MUST be “Ajax”. Yes, we are to blame too. “That is a cool ajaxian component”. No. It is a dhtml rollover. There is no Ajax interaction model in place.

So, if you know someone who calls every piece of JavaScript “Doing Ajax” let them know about POJ.

Next we will need to have a term that tells people “actually that is just CSS. No JavaScript code was needed for that effect”

Two Key Challenges for Ajax Adoption that We Have Ignored

Filed under: Web 2.0 News, Front Page, Editorial, Ajax — Chris Cornutt at 8:26 am on Wednesday, July 12, 2006

In this new article over on the Ajax World Magazine site, Coach Wei talks about the two major hurdles that are really hindering Ajax’s widespread adoption in both the corporate and non-corporate worlds. He also wonders why no one’s doing anything about them…

There are some fairly big issues with Ajax and I am puzzled. I think the Ajax community need to pay more attention here in order for Ajax to be really adopted.

He goes for the positive before the negative, talking about his personal position on Ajax and general support of it. With his standards in place, he gets to the bad news - the two things no one really wants to talk about:

  • 10% browsers have Javascript support turned off. It means that 10% users can not access Ajax-based web sites or applications. This is definitely a problem for Ajax.
  • Taking the issue a little further, let’s talk about accessibility. […] Most Ajax applications use Ajax widgets that may or may not support accessibility.

He briefly describes each, but doesn’t offer much in the way of solutions to rid ourselves of these problems. Degradable javascript practices can handle some of the problems these two topics might cause, but accessibility is still an issue even then. Suggestions? Comments?

Kabuki Withdrawn from Apache

Filed under: Web 2.0 News, Front Page, Editorial — Dion Almaer at 9:09 am on Thursday, June 29, 2006

Andy Clark of Zimbra wrote a letter to the Apache Incubator where he explained why the Kabuki contribution was now withdrawn.

A few of the things we’ve learned:

  1. Most parties in the OpenAjax initiative believe one sweet spot for AJAX toolkits will be for augmenting existing HTML pages. This is a more evolutionary approach that provides a more generic fallback in terms of accessibility, legacy clients, and so on. So a key constituency is the “HTML design center”, and today we believe Dojo to be a better choice for HTML developers than Kabuki.
  2. At least some of the Java UI developers prefer to continue to do their coding work in Java and then map the resulting application to Javascript for deployment. This is the model at the heart of the Google Web Toolkit (GWT), which is directly targetted at the “Java design center”, and is now available under the Apache license.
  3. Kabuki, which targets object-oriented programming in Javascript, retains its sweet spot for developing more revolutionary AJAX applications (”Javascript design center”) that seek to take the full advantage of the browser’s capabilities in native Javascript.
  4. We think that Kabuki is an ideal fit for a certain class of Ajax solutions but not for others. As such, we expect Kabuki to co-exist with Dojo, GWT, and others. We now agree with other members of OpenAjax that a peer relationship between these projects is best. We feel that this approach facilitates sharing and collaboration and is better than an approach where one project has a special relationship with Apache while others do not.

Is this a big deal? We don’t think so. A lot has changed since Zimbra kindly put this out there, and other open projects already exist for users. I think it is a service to NOT have another Ajax framework waving around, especially one that looks like Java in JavaScript? :)