By People, For Documents
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?
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
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.
Introduction to Scala
I gave an Introduction to Scala talk yesterday for the software team I am a member of. I have included here the slides and code examples used in the presentation.
Presentation
Code Examples
Hello World
package org.breidecker.scalaexamples
object HelloWorld {
def main(args : Array[String]) : Unit = {
println("Hello World!")
}
}
// Notes:
// 1. main method is required to run
// 2. ": Unit =" is optional
// 3. Unit in Scala's is similar to Java's void
Hello World #2
package org.breidecker.scalaexamples
object HelloWorld2 extends Application {
println("Hello World!")
}
// Notes:
// 1. Application provides the main method
// 2. The println statement is in the object's constructor
Accessors
package org.breidecker.scalaexamples
object Accessors {
def main(args : Array[String]) {
val person = new Person;
person.firstName = "" // Try different values here
person.lastName = "Smith"
println("Hello " + person.fullName + ".")
}
class Person {
private var theFirstName = ""
var lastName = ""
/* Overide the first name getter. */
def firstName = theFirstName.toUpperCase
/* Override the first name setter. */
def firstName_=(firstName : String) {
if (firstName != null && !firstName.trim.isEmpty) {
theFirstName = firstName
} else {
throw new IllegalArgumentException("First Name must contain a value.")
}
}
def fullName() : String = (firstName + " " + lastName).trim
}
}
// Notes:
// 1. The firstName property on the Person class is providing accessor method for the property
// 2. The instance variable for firstName had to be renamed to avoid a name conflict with the getter method
// 3. The lastName property is being referenced in the main method with its default accessors provided by Scala
List Comprehension
package org.breidecker.scalaexamples
object ListComprehension {
def main(args : Array[String]) {
for (val color <- Colors.ALL_COLORS) {
println(color.name)
}
}
/* This is an immutable class */
class Color(newName : String) {
val name = newName
}
/* This is a Scala singleton object */
object Colors {
/* These are Scala constants. */
val blue = new Color("blue")
val green = new Color("green")
val red = new Color("red")
val yellow = new Color("yellow")
val ALL_COLORS = List(blue, green, red, yellow)
}
}
// Notes:
// 1. This example simply shows how to iterate over a list of values in Scala
Twitter Client
package org.breidecker.scalaexamples
import java.net._
import scala.xml._
object TwitterClient {
def main(args: Array[String]) {
val screenName = "robbr" // Follow me! Try another Twitter name
val url =
new URL("http://twitter.com/users/show.xml?screen_name=" +
screenName)
val conn = url.openConnection
val xml = XML.load(conn.getInputStream)
val status = (xml\"status"\"text").text
println(screenName + ": " + status)
}
}
// Notes:
// 1. Scala uses an underscore instead of an asterisk for its package wildcard character
// 2. Java's network package is imported
// 3. Scala's built-in XML library is used
// 4. This example makes a URL request to Twitter for the current screen name
// 5. It then uses an XQuery like statement to reference status text
The Strange Loop
Alex Miller just announced most of the sessions for The Strange Loop developer conference to be held in St. Louis, MO on October 23, 2009.I will be attending as well as a number of people I work with. I’m expecting a big turnout, as there is a lot of buzz in St. Louis right now about the conference. And there should be. The list of sessions and speakers is quite impressive.
Larry Ellison’s Cloud Computing Comments Revisited
Back on September 26, 2008, Larry Ellison (CEO Oracle) made the following comments about cloud computing. Larry was quoted by the Wall Street Journal as saying…
“The interesting thing about cloud computing is that we’ve redefined cloud computing to include everything that we already do. I can’t think of anything that isn’t cloud computing with all of these announcements. The computer industry is the only industry that is more fashion-driven than women’s fashion. Maybe I’m an idiot, but I have no idea what anyone is talking about. What is it? It’s complete gibberish. It’s insane. When is this idiocy going to stop?
“We’ll make cloud computing announcements. I’m not going to fight this thing. But I don’t understand what we would do differently in the light of cloud computing other than change the wording of some of our ads. That’s my view.”
With the announcement yesterday that Oracle is buying Sun, it will be interesting to see what this means for Sun’s cloud computing technology.
The rant against cloud computing was well covered at the time, but I couldn’t help but to think about it again in light of yesterday’s big news. Actually, my favorite part of the quote is that part about software being like woman’s fashion. So true sometimes.
Time For An Update
My last post was on December 31 of last year. I know everyone is waiting on pins and needles for my first post of 2009. I’ve been very busy with work and life as well as suffering a writers block, so I thought to get things going again I’d post an update of what I have been up to.
- I’m now managing a software group at IEI. I’m also still writing code. Balancing both responsibilities will be an exciting challenge for me this year.
- Java is the primary technology and language I develop software in. The new language I am focusing on is Python. I already written a number of things in Python, but still have a long ways to go in mastering the language.
- I didn’t get a chance to attend No Fluff, Just Stuff in St. Louis this weekend. Last year’s was very good, so this is a bit of a disappointment.
- I’ve attended a couple of the Lambda Lounge meetings, so far this year. This is an exciting user group focused on functional and dynamic languages.
- I went skiing in Breckenridge a couple of weeks ago. The weather and the snow were both great. It rocked.
Thinking in Stacks (Revisited)
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)
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
Stack Overflow Ships
The new Stack Overflow web site finally went live. I won’t go into details about it, because you can get them here. I’m excited about this programming Q&A site, because I use Google and other online resources many times every day to answer technical questions, find code examples or simply take a pulse of what technolgies other developers are using. I really like this site’s social networking take on programming Q&A. I havea strong feeling this site will become a very used tool in my programmer’s toolbox.