Online Book Reader

Home Category

Beyond Java - Bruce Tate [9]

By Root 648 0
the inside of a loop in a library.

Taken by themselves, these features can make you much more productive. But add the other features of a dynamic language, and you can see incredible power and productivity very quickly. Many of the so-called scripting languages make much more sense for application developers.

Metaprogramming


The Java community is now investing enormous energy into programming styles that are more transparent, reflective, and dynamic. These approaches are called metaprogramming , because they spend more time in the realm of the class than the object. It makes sense that you can get more leverage that way. Transparent persistence frameworks like Hibernate teach generic classes and collections to be persistent. AOP lets you extend a specified list of methods with custom code, without requiring modifications of that method. These problems are metaprogramming problems.

When Java experts get excited about metaprogramming, they often wind up adopting other languages. Want some examples? David Geary, one of Java's most successful authors and JSF expert group member, is aggressively learning Ruby on Rails , and is writing a Rails book. James Duncan Davidson, creator of Tomcat and Ant, left the Java community to code Objective C for the Mac environment. And, as you have seen, Justin Gehtland and I are using Rails to implement a web-based application for a start-up.

Think of metaprogramming as building a high-level builder. Ruby on Rails, for example, discovers the columns and relationships in a database schema, and uses that data to build a model, view, and controller for a web application. The characteristics of the environment are striking:

It's incredibly productive. It's easily five times as productive as the closest Java competitor, for certain types of problems.

It is flexible. Some solutions build a default application and allow common extension points. Rails builds a default application, which you can extend as if you'd written it yourself.

It reduces duplication, and leads to more consistency.

To me, for enterprise application development , the overriding characteristic of a language or environment is productivity . I want each line of code to work harder, and I want that to translate into productivity. I don't quit measuring productivity after deployment. If your tiny application is impossible to maintain, you'll lose everything you've gained. For these reasons, I love Ruby on Rails, and I'll talk more about it in Chapter 7.

Continuation Servers


Java web developers spend an incredible amount of time managing state, threads, and the Back button. These problems get significantly more difficult as sites get more dynamic and complex. There's been a recent resurgence in Smalltalk, and most of it centers around a framework called Seaside. Since continuations maintain state, continuation-based servers don't have any problem managing state. They also handle Back buttons and threading with relative ease. This framework uses a language feature called continuations to maintain state within a web-based application.

The Premise


I don't mean to say that Smalltalk or Ruby will take over the world tomorrow. I don't even mean to say that anything will ever achieve the success that Java has, again. But I don't believe that Java is permanent. For five years, it's been a good strategy to ignore the borders beyond Java, but no language will keep its leadership position forever. By now, the premise of this book should be taking shape for you:

Java is moving away from its base. Hard-core enterprise problems may be easier to solve, but the simplest problems are getting harder to solve. And...

Java is showing signs of wear, and interesting innovations are beginning to appear outside of Java. So...

It's time to start paying attention again.

Pick up your eyes. Start by picking up this book. You'll be glad you did.

Chapter 2. The Perfect Storm


The power and the fury of the storm caught us off guard. El Niño, a weather pattern famous for producing a continuous

Return Main Page Previous Page Next Page

®Online Book Reader