By People, For Documents

Posted by Rob on July 24, 2010

I am not worried about Flex, Silverlight, JavaFX or some other rich Internet application (RIA) technology replacing HTML and the other standard web technologies on the Internet. The Internet’s success is because standard web technologies have made it easy for people to create and share documents.

HTML editors like Hot Dog, Front Page and others made it possible in the early days of the Internet for any person to create a simple web page and easily publish it onto the Internet. Technical savvy folks then quickly learned you did not need an HTML editor at all and merely a text editor.

Today, tools like WordPress and Blogger make it easy for millions of people around the world to publish blogs using standard web technologies. Social web sites like Facebook and MySpace allow for millions of people to create personal web pages using standard web technologies. Additionally, the most popular web applications on the Internet today, such as Google, Twitter, LinkedIn, eBay and Amazon, make heavy use of standard web technologies. Popular Web 2.0 sites, such as Basecamp, Digg, Flickr and Delicious, do the same.

These tools and applications all share a common feature. They make it easy for people to work with and view text documents. Text can easily be moved from one format to the next. It can be formatted, printed, scanned, emailed, indexed, syndicated, copied and pasted.

I do agree that browser compliance has been a big issue. However, the Firefox and Chrome web browsers has redefined what is means for a browser to be standards compliant. This and reusable JavaScript frameworks like jQuery, YUI and Prototype are making cross browser compliance a thing of the past.

The advent of Ajax only solidifies the popularity of the current web technologies for years to come. Ajax is the glue between document centric web pages and RIAs. I have seen Ajax compared to a spice. Add a little bit here and a little bit there. If you think you need more, then add some more. Because Ajax uses standard web technologies, it becomes easy to mix Ajax into existing document centric web pages, while still maintaining the essence of those pages.

Sure, RIAs have their place. Many commercial web sites seek to thrill their users with animation, special effects and advanced controls. Certainly, there is a domain outside of document centric web sites where they are needed. But RIAs will not replace standard web technologies as the dominant technology used on the Internet. Casual Internet users are not going learn how to create RIAs. They are simply going to continue to create effective, HTML based documents.

Documents have stood the test of time. In today’s high technology world, documents allow people to easily participate and share ideas. And technologies that support documents, such as HTML, CSS and JavaScript, will continue to rule the Internet for years to come.

The Next Big Language: For the Enterprise or the Masses?

Posted by rob on February 27, 2010

There’s a lot of talk these days about what will be the next “big” language. A lot of my fellow Java developers believe its going to be a language that runs on the JVM. Will it be Scala, Clojure, JRuby or some other language that has yet to be written? I think when we have such discussions, we need keep in mind that while the JVM may be the most popular platform for enterprise software development, its not the most popular platform for general purpose Web development. That distinction goes to LAMP and PHP.

Wordpress, Joomla, Drupal and many other immensely popular blogging and CMS software packages are mostly written in PHP and run on Apache servers. And there are countless Web hosting companies that will host applications running on these software packages for less than $10 a month.

I was recently looking into options for creatng an online store. If I were to go the JVM/Java route, I would need to mostly write that store myself or purchase expensive software to implement it with. I would then need to pay a high monthly fee to host the application on a JVM. This would be fine and probably desirable for a large Fortune 1000 company or a Web startup with lots of funding. However, for myself, I want to start with something I can develop as cheap and quickly as possible. With the popular PHP tools I mentioned, I can find multiple free or very low cost ecommerce plugins and themes I can install and have hosted for a small monthly fee. These tools also create Web sites that look attractive, modern and professional.

Although the JVM and Java has revolutionized software with its ability to run on many operating systems, its dominance is only in large enterprise business software. If there is to be a next “big” language, I think possibly it will be one that can bridge the gap between enterprise software and the general purpose software used by the masses.

Java Web Applications - Bring on 2010

Posted by rob on December 09, 2009

No longer are conversation about what is the best Java Web framework very interesting. With the onslaught of new programming languages for the JVM, that conversation has shifted to one about which technologies make the best mix for a Java Web application. There are so many languages and framework available for the JVM today, that the Web framework itself is no longer a major concern. Its really about what language you want to be coding in which layer.

I am very excited about the upcoming year. The recession has held back many of the new technologies from taking off in a big way on the JVM in 2009. However, JVM enthusiasts have been hard at work learning and innovating with the many new languages and technologies available today. When the economy picks, I have no doubt we will see dramatic changes in the JVM technology landscape.

Toodle-Li-Do, Toodle-Li-Dum

Posted by rob on April 08, 2009

I have finally found a satisfying to-do list solution for my iPod Touch. Its called ToodleDo. For $3.99 ToodleDo has an iPhone/Touch application that can sync up to a ToodleDo basic (free!) Web account. I’ve been looking for this since I got my Touch over a year ago.

Java Support Added To Google App engine

Posted by rob on April 08, 2009

In what is great news for the Java community, Google has added support for Java to the Google App Engine.

Google adding Java support to App Engine

The Easy Way to Select a Java Web Framework

Posted by rob on December 11, 2008

Sorry for the delayed post. Things have been very busy lately. Besides, I just don’t get around to writing as many blog articles now that I use social networking applications like Twitter and Facebook.

The most difficult part of writing this article was getting started. I didn’t want this article to be another taxonomy of Java web frameworks like my original article. Instead, I wanted this article to present a pragmatic way to select a framework that is easy and matches the things that you and your team find valuable to software development.  Let’s get started.

Instead of looking at the numerous features of web frameworks, I’m instead going to focus on three high level categories. They are “safe choice”, “cutting edge” and “rich user interface”.

Safe Choice
If you work for an enterprise where going with the tried and true is looked upon more favorably than taking a risk on something new, then you fall in to the “safe choice” category. Another motivation for going “safe” is that you want a standard set of Java and web technologies to work with. Since JSF is a Java specification, many of the major JSF implementations will work here. If you go down the JSF path you will most likely end up looking at JBoss Seam to work as a middleware solution for your JSF front end. There are a lot of folks out there that do not like JSF. If that is the case then your best choices are Spring MVC and Struts2. With Spring MVC you will most likely also be looking at using the Spring Framework and Spring Web Flow for your middleware. The Spring suite of software libraries is immensely popular these days and their penetration into the enterprise has been immense. Struts2 is for those who feel like it is the best migration path for existing Struts applications. Remember that Struts2 isn’t really a Struts upgrade. It is actually the wonderful WebWork framework that has been refactored, renamed and adopted by The Apache Software Foundation to be to the formal replacement for Struts.

Cutting Edge
If you work in an environment where management is more tolerant of trying new technologies, you are on a team that has a ton of Java web experience or you are simply excited by trying new things, then selecting a “cutting edge” framework may be for you. Without going too much into these frameworks, I will simply list out some of the popular frameworks that fall into this category. They are: Tapestry, Stripes, Wicket, Ruby on Rails on JRuby and Grails. These framework are either not adopted to the extent that the “safe choice” frameworks are, or they employ the use of dynamic languages. An interesting choice in this category is Grails, because it is written on top of Spring MVC, which is a “safe choice” framework.

Rich User Interface
Do you need a rich user interface instead of a more standard HTML one? Do you want a full AJAX interface instead of one with small amounts of AJAX mixed in? Only you will be able to answer these kinds of questions based on your business and technical requirements. If you answer “yes” to either question, then you are in what I consider the be the “rich user interface” category. And by definition if you want a rich user interface, then you have already left “safe choice” category. I don’t have as much experience in this category, so I will tread lightly. Choices in this category include Google Web Toolkit, Echo, ICEFaces (also a JSF implementation) and the new JavaFX.

Conclusion
There are countless choice, but selecting a Java web framework doesn’t have to be hard. You just need to know your environment and values that are important to you. Not making a choice at all will make selecting a framework hard, so don’t let this decision take too long. Regardless of what Java web framework you end up selecting, the days of using only one framework is a thing of the past. If your selection isn’t working out or if you think some other framework is a better choice for another application, then by all means select a different framework. Good luck.

SpringSource Acquires Groovy/Grails Company, G2One

Posted by rob on November 11, 2008

Spring is a huge name on the Java landascape. The Spring based web framework, Spring MVC, is also well known, but doesn’t really capture the big headlines like Spring or some other web framework. SpringSource, the company behind Spring, today has announced that it is acquiring G2One, the company behind Groovy and Grails. Since Grails is built on top of Spring and Spring MVC, this appears to make a lot of sense. I think its a safe bet that Grails adaoption will pick up significantly. This is definitely a headline grabber.

Thinking in Stacks (Revisited)

Posted by rob on September 23, 2008

This is the third of three previously published articles related to Java web frameworks that I am republishing. This one is from about fifteen months ago. Choosing the correct stack of software to support a web framework is important. You can either build your own stack or choose from an already integrated stack.

———————-

The number and diversity of Java frameworks (and web/MVC frameworks in particular) is a great thing. But along with choice also comes drawbacks. Which frameworks do I choose for a new web application? Project X is using frameworks A, B and D - do you know these? Are they production worthy? I have heard for every project you should choose the best tools (or frameworks) for the job. Really? I tend to agree to an extent. But is one Web application so different from the next that I need to reevaluate which frameworks I use on each new project?

This leads me into what I really want to discuss. I believe there has been a positive development in the Java world, in that popular “stacks” of open source software are beginning to emerge for developing web applications. I am defining “stack” as simply “multiple software frameworks integrated and used together”. Wikipedia defines a similar term, solution stack. Should project teams start making stack selections instead of framework selections? While frameworks maybe should ultimately be selected based on their individual merits, I think a popular stack can be a great place to start. Some of the benefits of using a popular stack include: accelerated startup time, reduced learning curve, increased software quality and increased knowledge base. So far, I see three stacks emerging as the most popular.

The first stack is the Spring/Hibernate stack. Maybe this one is the most obvious. Over the last fews years Spring and Hibernate have become so popular that they have almost knocked EJB2 out of existence on new projects and forced the creation of the new EJB3/JPA specification. I think this stack is still maturing, in that projects are adding everything Spring has to offer in addition to the already popular Spring IOC and Spring Transaction frameworks. By that, I mean using Spring MVC for the web tier, Spring Web Flow for work flow and any other Spring frameworks that are found to be useful. Maybe I should simply call this stack the “Spring stack”. It should be noted that the very promising Grails framework is built on top of Spring MVC, Spring IOC/Transaction and Hibernate.

The second stack is the JBoss Seam stack, which is basically a stack by definition. JBoss Seam ties together the JSF framework specification, using MyFaces for its default implementation, to the JPA specification, using Hibernate (another JBoss product) for its default implementation. The JBoss Seam framework itself adds work flow and other capabilities to the middle of the stack. Other JBoss frameworks like JBoss Rules can easily be integrated into the stack. If you like the idea of working with J2EE specifications and tools designed for J2EE specifications, then this stack may be the one for you. A big positive of using JBoss Seam is that it reportedly handles of lot of issues developers encounter when working with JSF.

The final stack is the Ruby on Rails (RoR) stack. JRuby 1.0 has just been released and is expected to execute close to if not 100% of RoR applications on the Java platform. The increasingly popular and much imitated RoR gives you everything you need in one package, with ActiveRecord for persistence along with MVC functionality and much more. If you have ever read or listened to interviews with RoR creator, David Heinemeier-Hannsen, you might recall him talking about why he created RoR as a way to quickly create a new web application without having to start from scratch. David wants RoR to give you everything you need to create a web application right out of the box, with little or no configuration, so you can focus on the business logic and not the underlying framework code. I mentioned that the Grails framework/stack is built on the top of the Spring/Hibernate stack. Grails is a Java implementation of a RoR like framework.

This discussion wouldn’t be complete if I didn’t mention the AppFuse project. Created by Matt Raible, AppFuse let’s you quickly create an application skeleton using various combinations of the most popular Java frameworks. Without going into too much detail, you can choose from four popular Java web frameworks (Struts2, JSF, Spring MVC and Tapestry) and three Java persistence frameworks (Hibernate, iBatis and JPA). Spring is used to tie everything together. I think of AppFuse as being a nice alternative to choosing one of the above stacks, while still getting many of the same benefits.

The downside to the emergence of these popular stacks is there are some great frameworks not included in these stacks and not getting as much attention as a result. A few that come to mind are Struts2, Tapestry, Wicket, Rife, Guice and Google Web Toolkit. While I feel having a small number of popular stacks is a good thing, I also see diversity and innovation as good things. I guess you have to make a choice between what is most important to you, starting with a small group of popular technologies, or selecting from the latest and greatest.

If stacks truly become the way the Java community prefers to view software in the future, I think we’ll start to see the creation of new frameworks slow down and a lot more activity continue around the already popular stacks. In true Java tradition, perhaps there will even be a couple new stacks show up in the next year (Google stack anyone?).

Web Conversations in Java (Revisited)

Posted by rob on September 19, 2008

In the spirit of selecting a Java web framework, I am going to republish a couple more articles related to the subject that were previously published on this blog. Below is an article I published over a year and half ago related to web conversations in Java. Support for web conversations is an important topic when selecting a Java web framework. If anything its probably even more important today than when the original aricle was published, since the subject is better understood today and by more people.

————————-

Sometimes in a Java Web application you may want to pass data from one screen to the next. A shopping cart is a good example of this. Another is a “wizard”, which leads the user through multiple steps when entering data. You can pass the data from one to screen to next in a stateless or stateful way depending on how you want to design your application.

With shopping carts, if you were to open two of them for the same Web site at the same time, the data entered into one would probably step on the data in the other. I think to most users this is understood and I believe most of us know that opening a shopping cart more than once is a bad thing. However, in a business application, it may actually be desirable for a user to open a wizard more than once at the same time. If this is the case, then multiple instances should not step on each other.

There are many factors to consider when deciding to make a Java Web application stateless or stateful, but I won’t go into those issues here. Its a very complex decision and there are many chapters in many books dedicated to the subject. Let’s assume we want a stateful application. For our wizard screens, using the HTTP session object simply will not do the trick for us. The HTTP session object is generally shared by each instance (window or tab) of a type of browser (Firefox, IE, …). If you have multiple Firefox browser windows open, they will still still share the same HTTP session. Its not entirely consistent on how this works, but to describe this behavior would take too long here and is the subject for another day. What we need is memory that is not shared by each of the wizards. We need data that is scoped to a series of user interactions in the wizards. What I have found is that this concept is starting to be referred to as a “conversation”.

A “conversation” can be thought of as a series of interactions between the user and the Web application. In this discussion our user interaction is taking place in the wizard pages, where the user inputs data and moves from one screen to another in order to complete their data entry. In order for conversations to be properly supported, multiple conversations need to be able to take place at the same time. This would allow us to have multiple wizards open at the same time. I think of conversation scope as being in between session scope and request scope.

There is a Java Web framework that is formally supporting conversations, Seam. In Seam, you actually specify in your Web pages when you want the conversation to begin and end. Seam takes care of the programming on the server side to make it all work. It would be nice if more frameworks would support conversations in this way. I haven’t used Seam yet, but this feature may be a good reason to give it a closer look.

Spring Web Flow is another framework supporting conversations. It is a layer that sits behind a Web framework such as Struts or Spring MVC. Spring Web Flow appears to be very in depth in its support of conversations. Given the popularity of the Spring Framework these days, I would recommend giving

Choosing a Java Web Framework (Revisited)

Posted by rob on September 18, 2008

About eighteen months ago, I published the following article on this web site. To this day it still remains the single most read article that I have published. I am currently in the process of selecting a Java web framework for a project I am working on, so I thought it would be interesting to revisit the process again. In the upcoming weeks I plan to write one or more articles on ideas related to this activity.

————————

Choosing a Java Web framework for your project is not getting any easier. With the GA release of Struts2 this week, its seems like the Java Web framework comparison is back in play. Here are some things I think about when choosing a Java Web framework.

  • Is it action based? Action based frameworks generally map actions (defined in an HTML form or URL) to code in the controller tier of the application. Action based frameworks are the most popular type of framework. Most developers have had at least some exposure to these kinds of frameworks. The most popular Java Web framework, Struts, is an action based framework. Examples: Struts, Struts2 (based on WebWork), Spring MVC, Stripes, Ruby on Rails (requires JRuby to run in Java), Grails
  • Is it component based? Component based frameworks create a component abstraction in the view tier. Event listeners capture user actions and map back to code in the controller tier. I am of the opinion that component based framework have a steeper learning curve than action based frameworks. Some will counter that component based frameworks offer greater productivity, once the framework is learned. Programming in a component based framework can sometimes feel like programming Java Swing components. Examples: JavaServer Faces (JSF) implementations (MyFaces, Tapestry, RIFE, Wicket, Google Web Toolkit (GWT), ThinWire, Echo2, IceFaces (JSF implementation), Click
  • Is it page based? Page based frameworks allow you to develop application made of many Web pages. To implement these Web pages, the developer creates HTML (using JSPs or templates), JavaScript and CSS files. All action based frameworks (that I know of) and some component based frameworks are page based. Most of these frameworks now have good support for AJAX. Because you write the Web tier yourself, you also have a lot of control and the ability to adhere to Web standards. Struts is a page based framework. Examples: Struts, Struts2/WebWork, Spring MVC, Stripes, Ruby on Rails (requires JRuby to run in Java), Grails, RIFE, JavaServer Faces (JSF) implementations (MyFaces), Tapestry, RIFE, Wicket
  • Is the Web tier generated? New AJAX frameworks such as Google Web Toolkit, require you to only code in Java. They then generate the entire Web tier for you, so you don’t have to code the HTML, JavaScript or CSS. You will still need to understand CSS concepts in order to style you components. This may be attractive you if you or your team doesn’t have much experience with JavaScript and CSS or you want to keep all of you application logic within Java code. These frameworks are component based and the style of programming is very similar to Swing. AJAX is used heavily by these framework to create a rich user interface. In traditional frameworks, there are many Web pages that work together to form an application. These frameworks may only have one page (a frame) where components and screens are swapped out using AJAX. Examples: Google Web Toolkit (GWT), ThinWire, Echo2, IceFaces (JSF implementation)
  • Is it JSP based? Many frameworks, including Struts, use JSP pages to generate HTML. JSP (JavaServer Pages) are the classic way to generate Web pages in Java. Tag libraries are used within JSP pages to generate HTML. Custom tags can be created fairly easily to add your own functionality. JSP pages get compiled into Java Servlets. Examples: Struts, Struts2/WebWork, Spring MVC, JavaServer Faces (JSF) implementations (MyFaces), Click
  • Is it template based? Some frameworks offer an alternative to JSP pages known as a template. Sometimes a framework only works with templates, while there are also lightweight template libraries, such as Velocity or FreeMarker, that can be used in combination with JSP frameworks. A template is often an HTML file with references to Java components made within the HTML code. Because these files are not JSP pages, they bypass the JSP API which many developers do not like to use. This also give some templates the ability to be viewed by a browser, which makes them nice for Web designers. I list some examples of frameworks that use template out of the box. However, as I mentioned earlier, JSP based frameworks can be made to work with templating technologies. Examples: Facelets (a view handler that can be used with any JSF implementation), Tapestry, RIFE, Wicket, Velocity, Clay (part of Shale), FreeMarker
  • Is it Rails like? The hugely popular Ruby on Rails (RoR) framework has defined its own class of Web framework. Without going into the framework itself, two fundamentals of this framework are “convention over configuration” and “don’t repeat yourself”. Rails like frameworks generate a lot of the application structure up front to make it easy to get up and running. Examples: Ruby on Rails (requires JRuby to run in Java), Grails, Trails
  • Does it support a dynamic scripting language? Many frameworks now have support for dynamic scripting frameworks. If you would rather do most of your Web programming in a scripting language rather than Java (there are many who would), then one of these frameworks might be for you. They tend to be action and page based and have good support for AJAX. Examples: Ruby on Rails (requires JRuby to run in Java), Grails (using Groovy scripting language)
  • Does it support IoC? You will often hear this referred to as “Spring integration”. The Spring Framework is a full stack J2EE application framework. There are many different sub-frameworks within the Spring Framework, and its Spring IoC (inversion of control or dependency injection) framework is its most widely used. IoC frameworks can make it easy to configure Java beans within your application, as well as provide a number of other benefits. Most of the popular frameworks have support in one way or another for Spring IoC. If this is important to you, then you should make sure the framework you are selecting makes it easy to work with Spring IoC. There are other IoC frameworks out there, such as HiveMind and Plexus, but Spring is currently the standard.
  • Does it support Web conversations? Supporting Web conversations is about tracking state across several pages, so if you are using a framework that is page based, then this may be important to you. If it is, then JBoss Seam and Spring Web Flow are frameworks to consider. They are not Web frameworks, but server side frameworks that integrate into the middle tier of your application. Seam uses JSF for its Web tier. Spring Web Flow can integrate with various Web frameworks. Shale, a framework for JSF, also includes support for conversations, as well as RIFE.
  • Is it testable? Many of the popular frameworks are building in formal support for mock objects and other testing concerns. Testing is critical and Web applications tend to be difficult to test.
  • How well does it support security? Is it well supported and maintained? Is it stable? Will it help me adhere to standards? These are things I think about on all projects when selecting a framework and they apply here as well. Especially here, since there are so many Java Web frameworks to choose from and new ones are showing up each month.

Matt Raible has done some excellent work in the area of Java Web framework comparisons. He is going to present an updated comparison comparing Struts/Struts2, Tapestry, Wicket, MyFaces (JSF), Spring MVC and Stripes at the upcoming ApacheCon in Europe.

I have only listed some of the most well known frameworks in this article. There are many more available, and too many to list all of them here. If I left out a framework that you feel strongly about, please leave a comment and let us all know about it. If there are additional things you think about when choosing a Java Web framework, let us know those as well.