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.

Scala Links

Posted by rob on August 18, 2009

Here is a list of Scala links I compiled for an Introduction to Scala presentation I posted on this blog a couple of weeks ago. I am posting the list as a separate entry, because I plan to add to it as I come across new links.

JVM Language Job Trends

Posted by rob on August 15, 2009

I thought it would be interesting to see what the job scene looks like for the various JVM languages out there. The languages I chose to feature on my Indeed.com trend chart were Groovy, JRuby, Jython, Rhino, Scala and Clojure. The order in which I listed them is the order I figured they would be in, with Groovy being the highest and Clojure being the lowest. Based on the results below, I was correct on the highest and lowest. However, its the results in the middle that are the most interesting. Jython is neck and neck with Groovy for the top spot. JRuby is second to last and in decline. Scala looks to be on the rise. Can we trust these results as a barometer for the future of these languages on the JVM? Let me know what you think.

You can click on the image below to go to Indeed.com and see a larger version of the chart.


groovy, jruby, jython, rhino, scala, clojure Job Trends graph

groovy, jruby, jython, rhino, scala, clojure Job Trends groovy jobs - jruby jobs - jython jobs - rhino jobs - scala jobs - clojure jobs

Simple Songs

Posted by rob on August 15, 2009

When one see excellent, yet simple software, its not hard to admire its beauty. In the past few months, I’ve discovered a couple of amazing, yet simple songs from the band, The Breeders. The most amazing thing about these two songs is that they were released 18 years apart.

Fortunately Gone (released in 1990 on the album Pod)

Were Gonna Rise (released in 2008 on the album Mountain Battles)

The Spring Deal

Posted by rob on August 15, 2009

The Java world was a buzz this week with news that SpringSource is being acquired by VMWare. What does this mean for the future of Spring? In St. louis, Spring is very dominant, as I am sure it everywhere else. Spring has definitely given extra life to an aging Java programming langage. Now that Spring is entrenched as a dominant (if not “the” dominant) J2EE technology, will it be able innovate in order to keep up with a changing technology landscape?

SpringSource to be Acquired by VMWare

Introduction to Scala

Posted by rob on July 31, 2009

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

Posted by rob on July 29, 2009

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.

The Strange Loop

Twitter Client in Scala

Posted by rob on April 23, 2009

I’ve been playing with Scala a bit lately. Tonight, I was fooling around with Scala using an online, interactive shell called lotrepls. I decided to write a script that would call the Twitter API and return me the status for a Twitter user. The script takes a Twitter user name as input and prints that user’s status to the screen. It turns out that Scala has some built-in XML parsing capabilities that makes this really easy.

This is the script.

import java.net._
import scala.xml._
val screenName = "robbr"    // Follow me!
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)

I’ll quickly break down the script line by line for non-Scala people. Not that I’m a Scala export myself.

  1. Scala is completely interoperable with Java. Scala can call Java and Java can call Scala. In the first line, I am importing all classes in the java.net package to use for making a HTTP request later in the script.
  2. In the second line I am importing all classes in the Scala XML package.
  3. I set the screen name which is input to the Twitter status API call. I could instead prompt the user for the screen name using Console.readline(), but this doesn’t work with lotrepls.
  4. Set the URL for the Twitter status API.
  5. Open a URL connection.
  6. Load the XML output of the HTTP request into a variable. The “val” modifier makes the variable final, therefore it can’t be changed.
  7. I use an XPath like statement to navigate the XML for the data element I am looking for. I get only the text of that element.
  8. Output the screen name and status to the screen.

This script can simply be cut and pasted into lotrepls. Remember to switch to Scala before running the script. Use CTRL+ENTER to execute. That’s all there is to it. Enjoy.

Larry Ellison’s Cloud Computing Comments Revisited

Posted by rob on April 21, 2009

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.

End of An Era

Posted by rob on April 20, 2009

Sun agrees to be acquired by Oracle. This is huge news in so many ways. Oracle will own MySQL, the most widely used open source, relational database. They will now own OpenOffice/StarOffice, a competitor to Microsoft Office. Oracle acquired BEA last year, so acquiring Sun makes that acquisition all the more interesting. And Sun owns some up the best cloud computing technology out there. Hmmm, I can only begin to think about what this does to the software landscape.

Oracle to Buy Sun