The Importance of Feedback Loops
September 18th, 2007by Jeremy Thomas
I was talking with a colleague the other day about a major project that had been deployed to Production a few months ago for one of his clients. The solution is a “standard” J2EE application” (EJBs, JMS, Struts, JBoss etc.) and is used both behind the firewall for CSRs and on the internet for online order handling. While it is stable, there are a few quirks/bugs with the online component. Some of these bugs are discovered by testers, but interestingly the majority are discovered by “an industry community” which details them on a forum.
My colleague said the feedback they get from this forum is invaluable and has lead to many incremental system improvements. And best of all nobody has to pay an army of testers to find these holes in the system.
Talk about leveraging the longtail for business benefit.
Ruby is Slow
April 13th, 2007by Jeremy Thomas
I find it interesting as a blogger that, several months after a post is written, I get a flurry of comments on it. One tends to think that people only read the latest posts, but the evidence seems to contradict this perception.
Anyway, I found the recent post at rc3.org about RubyonRails being slow very interesting. I posted a few months ago about Java’s ability to scale with the long tail and recently received some well put comments indicating that the speed of Java is just fine, and that speed issues are generally caused by bad architecture. I argued that the popularity of PHP and Rails over Java in the Web 2.0 space seemed to show that those languages/platforms were perceived to scale well with the long tail (whereas Java seems to be king inside the Enterprise, which tends to have a much lower user base). It seems that, at least with Ruby on Rails, the perception was based more on hype than fact.
Twitter’s recent popularity has been a good Stress and Volume Testing ground for Rails, which is a relatively new platform, and it seems that Rails is much slower than Java, PHP or Python platforms. This idea is raised at rc3.org, where Rafe Colburn writes:
I do wonder, though, if this kind of information [Twitter’s statement that Rails is slow] is going to push some startups over to PHP or Java, even if they’d prefer the development efficiencies offered by Rails.
I’m pulling for Java.
Can JEE Scale with the Long Tail?
January 24th, 2007by Jeremy Thomas
I wrote a post a few weeks ago about styling JEE (aka J2EE, some people can’t shake the “2″ even though we’re up to Java version 5 now) applications to give them a web 2.0 look and feel. Since then I got to thinking about JEE and whether or not it’s really relevant to the Web 2.0 world.
The issue is scalability.
I’ve spent the better part of my career with my head down, headphones on, techno music thumping, banging out J2EE-based (and some .NET) EAI solutions for large enterprises. These applications, at best, were scoped to target a user base of 10,000, and we never expected to have more than a couple hundred concurrent web-based user sessions.
Contrast that to google.com which deals with a couple million concurrent user sessions. And I know google.com is not JEE-based. It’s likely built with a light-weight scripting language (probably Pearl or Python give my experience with Google and their enterprise applications) with a lot of load-balanced servers behind it.
I haven’t done any official research, but in my experience most of the web 2.0 sites I’ve come across have not been JEE-based either. Most seem to run PHP (digg.com). Some seem to run Ruby on Rails. There’s one web 2.0 site that I know of that’s run on the JEE platform, and that’s zoho.com (the “.do” at the end of some of the links on zoho.com, i.e. http://wiki.zoho.com/jsp/ wikilogin.jsp?targetURL=%2Fregister.do, is a “verb” in Struts, an opensource JEE model view controller from Apache).
The question is, can JEE scale with the Long Tail? With internet access being nearly ubiquitous, websites will potentially have to handle hundreds of thousands of simultaneous transactions. Is JEE, a framework that’s great for the enterprise where there are a relatively small amount of simultaneous transactions, appropriate for coping with world-wide scale?
I hope so. But maybe lighter-weight, narrow-purposed scripting languages are more ideal.
Anyway, if you have experience with JEE dealing with “internet-sized” volumes, or if you know of any other JEE-based web 2.0 sites, please let me know.
Web 2.0 Styles and JEE
January 10th, 2007by Jeremy Thomas
In my previous post on JEE and Web 2.0 I mentioned the use of ajax4jsf to “ajaxify” JEE web applications. I wanted to cover some additional resources we’ve used to add Web 2.0 features to JEE applications.
Rounded Corners
I’m not a graphics designer, and I struggle with tools like Gimp and MS Paint. I wanted to add rounded corners to my JEE web application and discovered roundedcrnr.com. Roundedcrnr.com automatically creates rounded corner images for you (in whatever color you like), and produces code you can incorporate into your webpage to create the rounded corner effect.
Visual Effects
The scriptaculous javascript library has some great visual effects that can be incorporated into a JEE application. There’s one trick here. By default JSF generates dynamic ids for page components, i.e. menu:_idJsp1:_idJsp39. Thus, when creating a visual effect with scriptaculous, such as “BlindDown”, the dynamic id of the component must be provided (as javascript is rendered on the client-side). To get around this, the Apache Tomahawk framework provides JSF controls with a forceId attribute. So, if a component is named menu at design time, it’ll be rendered as menu at runtime, which means you can pass menu, instead of menu:_idJsp1:_idJsp39, into your “BlindDown” javascript call.
Finally, no Web 2.0 application is complete without “spinner.gif“, which is used to show the user that “something is happening” as the mouse hourglass no longer takes effect when AJAX requests are processed. ajax4jsf has a status component that can be used to render spinner.gif when AJAX requests are executing.
JEE and Web 2.0
December 21st, 2006by Jeremy Thomas
It’s difficult not to mention Rich Internet Applications (RIAs) when talking about Web 2.0 or Enterprise 2.0. There’s one particular framework that stands out, and that’s Ruby on Rails. I have a lot of experience building enterprise applications in J2EE (or JEE as it’s called now) and .NET and wanted to understand what Ruby on Rails was all about.
So, I bought Agile Web Development with Rails - Second Edition. I read every page and did every tutorial (building a shopping cart application with a little AJAX magic).
Rails impressed me. Ruby did not. Ruby was invented in Japan in 1992 and was used without Rails until Basecamp came along and built Rails to “webify” Ruby. From what I’ve seen thus far, the Rails (and GEM and Rake) framework could have been created for any language. It seems that Basecamp had a bunch of Ruby programmers who one day decided to make Rails for Ruby because that’s what they knew. If instead Basecamp had a bunch of Java programmers we could be dealing with Java on Rails (although Java requires compilation, Ruby does not, so Rails might have ended up a little different).
What don’t I like about Ruby? For one thing, the method naming convention drives me nuts. In Java the convention is to use camel-casing, i.e. getCustomer(). But in Ruby, the convention is to use an “_”, i.e. get_customer. Furthermore, I can optionally insert the “()” (get_customer()), it doesn’t matter. Unbridled, the free-form and “flexible” nature of Ruby syntax could lead to unwieldy code, where one Ruby programmer finds it difficult to maintain another Ruby programmer’s code due simply to style differences (i.e. optional use of the return statement, optional use of {}). Furthermore, it is always better to detect and debug errors at compiletime rather than runtime, as runtime errors can often go unnoticed or be the result of something that happened 3 method calls ago (Ruby is a scripting language and is thus not compiled).
Ok, perhaps I’m just stuck in my ways. But, after reading my book I wanted to see if I could implement some of the cool AJAX and Scriptaculous features in a JEE application.
The first MVC (model view controller) I learned was ASP.NET. After 2 years of that I switched the JEE world and found a roughly comparable framework in Java Server Faces (JSF), and specifically Apache’s MyFaces implementation. JSF has a lot of support from the heavyweights in the software engineering industry including Sun, Oracle and IBM.
As of version 1.1.4 of MyFaces, AJAX does not come with it out of the box. So I found a great opensource project called Ajax4Jsf which essentially AJAXifies JSF applications. After resolving some version conflicts I was away, AJAX and all. Last I added visual effects with Scriptaculous and I was away.
The moral of the story is it is certainly possible to build Web 2.0-style interfaces using JEE, so there’s no need to abandon your Java programming skills just because people say “AJAX”, “visual effects” and “Ruby on Rails” in the same sentence. And certainly with mainstream adoption of data access frameworks like Hibernate it’s possible to simplify the process of database interaction in Java.
Follow Me