Technical Archives

Paul Browne

AddThis Social Bookmark Button

Tom Baeyens (jBPM / JBoss workflow project lead) has a good post on the jBPM (JBoss workflow) community day held at the Guinness brewery in Dublin. Warning - slides may contain pictures of people drinking beer.

In case you missed How to combine (jBPM) Workflow and (Drools) Business Rules (what do you mean that you were at Java One instead?) - here’s the summary. Slideset is available on this blogpost.

  • Workflow (e.g. JBoss jBPM) is great - it allows you to take spaghetti code and draw it as a workflow diagram (flowchart) so that it can be reviewed by the business (the nice people who pay our wages). You then attach standard (Java) actions to these steps.
  • Only problem is when you come to a decision node (the one circled in red below): How do you decide to go left or right (in the workflow)? Normally this is coded in Java - good for us, but hidden from those nice business people (which means that this is more room for errors-in-translation).
  • Business Rules allow you to keep those decision making rules in Plain English: When something is true , then do this. That’s it. The rule engine does most of the hard work.
  • Integrating Workflow and Rules is easy. Use JBoss Seam (link) or do it by hand (link). And it works on non-JBoss web / app servers such as Websphere, Oracle Application Server, Tomcat and Weblogic.
  • Repeat x6 : Use workflow and rules. Use workflow and rules …


simple-workflow.PNG

More information on:

In a maybe related development, Tom Baeyens is now using strangely Rules-y like examples over on his workflow blog ….

Hari K. Gottipati

AddThis Social Bookmark Button

As Flash’s strength is in UI development and Java’s strength is in services, security and distribution, lots of Java developers are adopting the Flash as their UI choice. When it comes Java ME development, its an application sitting on the mobile phones as opposed to traditional web application where the browser and server are involved. Until now, Java ME developers have only Java ME GUI APIs for UI development, but now they can enhance the UI with Flash technology. In an interesting turn of events, Sony Ericsson launching project Capuchin, which bridges the Java ME with Flash Lite by empowering these two distinct developer communities to bring their respective expertise to create more powerful mobile applications.

What’s all this?

Project Capuchin is a Java ME API that acts as a bridge between the Java ME and Adobe Flash Lite. It encapsulates Flash Lite content in Java ME applications. This API makes it possible to use Flash Lite as the front end and Java ME as the back end of applications. You can use your favorite Flash tools for UI design while still having access to all the phone services available to Java ME. Project Capuchin makes it possible to create Java ME applications where some or all UI components(you can mix Java ME UI and Flash lite UI, for example: Java 3D Game with Flash menus) are defined in Flash Lite and where all services can be accessed through Java ME. Though content is created by Adobe Flash technology, it makes it appear as Java ME applications.

Architecture:

capuchin.bmp
Source: Sony Ericsson

Project Capuchin makes it possible for Java to run a Flash Lite content file (*.swf) via the Capuchin APIs. It acts as a communication bridge(two way) between Flash Lite and Java ME, meaning that Flash Lite can send requests to and receive events from Java. It carries all system events (e.g. key events) from Java to Flash Lite and the Flash Lite player has a choice of listening to these events. In case Flash Lite wants to access some information then it is done through Cauchin API. Communication between Flash Lite and JSRs are handled through an intermediate class that works as a translator. This class listens to Flash Lite requests, transfers these to Java ME, and sends response back to Flash Lite.

Project Capuchin can be used in different ways:

Pure Flash Lite Content (Full Flash UI and services, no Java ME access):
The simplest form of using this technology is to take pure Flash Lite content (e.g. already existing games and apps developed in Flash) and encapsulate it in MIDlet suites (*.jar) using Sony Ericsson’s soon-to-be-available packaging tools. The benefit of this approach is that this Flash Lite content will be treated in the same manner as Java content, thus will use the same distribution infrastructure and system capabilities as Java ME content.

Java MIDlet using Project Capuchin as UI presentation layer (full Flash UI, Java Services):
More advanced use of Project Capuchin is to let Flash Lite handle the entire presentation layer and use Java as a service provider which feeds the presentation layer with necessary data.

Java MIDlet using Project Capuchin for some UI components (Java UI and Flash UI, Java Services):
In some cases such as 3D games, it is not feasible to use Flash Lite as a full presentation layer yet this should be handled using suitable Java technology (e.g. Mascot API, JSR 184 or JSR 239). In these cases, Project Capuchin could be used for presentation of some UI components, for example menus in 3D games.

Flash Lite has a solid UI, but there are no known mobile applications built on it. On the other hand, Java ME is popular in mobile application development without solid UI. So it makes sense to mash up these two technologies to deliver best mobile applications. Also as Flash lite is limited and poor in creating 3D games, so users can make hybrid UI(Flash Lite+Java ME UI) with project Capuchin. Sure it is going to open the doors for the best Java ME applications powered by Flash UI, but its success depends on how many devices it is going support it. There are no details on whether this is going to be restricted on Sony Ericsson devices? Its success depends on Sony Ericsson’s willingness to license this technology to other device manufactures. If so, we may see this running on iPhone soon. Steve Jobs is not happy with Flash Lite, but I am sure Java ME with Flash Lite will impress him!!!

Tim O

AddThis Social Bookmark Button

Despite some fashionable buzz to the contrary, Maven has gained momentum in the market. It has done so by consistently meeting criticism with objective self-evaluation and improvement. I’ve recently been trying to erase one of the main objections (lack of consistent and comprehensive documentation) by working on a Maven book which is still in an early alpha release stage. With the release of Maven 2.0.9 and the new focus on quality, I’m starting to see Maven expand its boundaries beyond the expected Java project. I’ve always known that people were striving to expand Maven beyond Java, but, until now, I haven’t really seen the promise realized. I’m starting with Flex because there is a recent abundance of quality Flex Mojos hosted outside the Apache Maven and Codehaus Mojo projects. Flex and Java seem to have a “special relationship”, and I think it is fitting that Flex is one of the first areas where Maven is starting to expand.

Adobe Flex 3 SDK: Open Source

For general content related to Rich Internet Applications (RIA), you’ll probably want to check out O’Reilly’s InsideRIA.com. I’m approaching Flex more from the perspective of a Java developer…

Here we are, a year after the anouncement of JavaFx, and, from where I sit, the energy is still with Adobe’s Flex and it has gained more momentum with Adobe’s release of Flex 3. Right now, you can download the open source Flex 3 SDK and start compiling and distributing Flex and AIR content without having to pay the piper. The compiler, the debugger, and the framework itself are released under Mozilla Public License v 1.1. To use Flex with Maven, you are going to want to download Flex from the Adobe site

If you want to use the Flex Eclipse plugin, you’ll need to fork over some cash. Flex Builder comes in two flavors Standard and Professional. Standard retails for $249 (USD) and Professional retails for $699 (USD). Yikes! Not cheap. The good news is that, unless you are creating a very complex application, you don’t really need Flex Builder. I happen to have a copy of Professional around for my own use, but I rarely use it because most of the work I’m doing in Flex these days is less visual and more about delivering data to the Flash client and programmatic creation of UI elements. If you are interested in buying Flex Builder, the main difference between Standard and Professional is that Professional has better testing support and charting/datavisualization components. But, I can’t stress this point enough, heavy duty programmers don’t really need the fancy UI.

The other thing to know is that there is a healthy community of Open Source that has grown around Flex like osflash.com and a number of projects providing open source components. (I wouldn’t be surprised if there is already another alternative Eclipse plugin which provides syntax highlighting and integration with the compiler. I just haven’t found it yet.)

Building Flex with Maven

Look around, you’ll see that a number of Java developers have blogged about integrating Flex with Java, here’s a survey:

Personally, I used Eyben’s archive as a starting point, and I’ve extended it using the israfil-mojo plugin to involve several projects of packaging SWF that all depend on a shared SWC. These SWFs are then copied into the WAR file during the packaging phase. This approach is useful, but if you are interested in using Adobe’s Flex Builder you should know that you may run into some problems. From my own experience, it appears that projects that don’t conform to Adobe’s file layout tend to have problems in the UI. (But, then again, I told you I’m not really using the Flex Builder IDE, I just don’t need it.)

Arbogast’s blog post (which I stumbled on via the Maven developer’s list) introduced me to the most recent stab at a decent Flex Mojo flex-compiler-mojo.

Tim O

AddThis Social Bookmark Button

Today Sonatype has introduced Nexus: a Maven Repository Manager.

Brian Fox’s blog entry Introducing Nexus contains a number of useful links.

“Enough talk, click on over to the Nexus site where you can find more information and the download link. We’d love to hear from you on our user list and on irc.codehaus.org #nexus. Also be sure to visit our Maven book, which contains a Nexus chapter.”

Tim O

AddThis Social Bookmark Button

I’m convinced that this blog platform doesn’t quite work. Blogs are supposed to be about random navel gazing, but instead of that I think people view the O’Reilly blogging platform as a political megaphone through which they can make themselves appear to be ubergeeks. Anyway, I’m going to continue to write here, but just know that I’m always reticent to say anything real here. Whenever I decided to say something like, “I’m sick of parsing Strings in Java” I’ll get a bunch of hate mail from people about how what I said didn’t fall in line with the expectations they had of OnJava. In addition, I’m very skeptical of the idea of “topical” blogs. I’ve never worked on a system that was in one technology. Enough self-reference.

Web Frameworks IM Log

I don’t think we have any clarity in Java Web Framework land, here’s a chat log from yesterday that has been anonymized to protect the innocent…the topic was, “What framework should we use?”

tobrien: Waffle
tobrien: GWT
tobrien: Wicket
tobrien: SpringMVC
tobrien: Struts2
tobrien: Django
tobrien: Rails
other: why not all?
tobrien: PHP
other: you should do it in all of them and then we can decide which is the most elegant
other: it should be a standalone AIR app
other: wait, silverlight
other: no. it should be a firefox extension
other: i know i know. do it in an excel macro
other: it would be more efficient. you could enter all the meta data in excel and just hit 'upload'
other: although... c++ would be faster
other: you know what, just use assembler
other: f*** it, we can do it in hardware
other: it can have a usb interface
other: win32 api?
other: too legacy. use XAML
other: wait. make it a cocoa app, dont want to be a ********
other: no, do it in a osx widget
tobrien: yo!
other: you can use javascript for those right?
other: facebook app

:-) I think I’m going to just do it in Wicket. The person I was conversing with is partial to GWT.

Adobe Fx

Here’s a fun little icon:

fx-screen.jpg

(Anyone heard anything about JavaFx?) I know APress published a book on it, but that seems a little crazy at this point. Adobe released a public beta 3 for Flex 3 and there’s an icon on my desktop “Fx”. That’s nice, so that’s what Ward meant when he noted that name overlap at JavaOne last year. Has Sun selected another name for JavaFx yet? Googling for JavaFX just brings up a bunch of Sun stuff, and an entertaining article from last May. Check out what Andy Patrizio wrote in May:

You know all that AJAX code you’ve been writing and tearing your hair out over as you attempt to get the JavaScript working in both Internet Explorer and Firefox? Yeah, that AJAX code (define).

It’s all going to be useless real soon.

Seriously? It’s going to be “useless real soon”. The internet “press” is crazy.

Anyone care to wager what the big announcement is going to be about JavaFX? What the new name is going to be? It was interesting when it was announced, I was impressed by C. Oliver, but I’ve also been impressed with Abode over the past year.

Tomcat Love

I’m a pulitzer prize winning author, I’ve written a few fictionalized accounts of my own experiences in Vietnam. And, my most interesting book is about my love affair with Apache Tomcat - “Tomcat in Love”. This is what happens when your name overlaps with someone much more famous and successful than yourself.

Tim O

AddThis Social Bookmark Button

Brett Porter has a terse branch in Maven that introduces an incrementally leaner syntax for Maven POMs. If you’ve used Maven, you’ve probably cursed it repeatedly for relying too heavily on an element only approach to XML configuration. To illustrate the problem, consider a Maven 2 POM declaring a simple dependency:

    <dependencies>
      <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1</version>
      </dependency>
    </dependencies>

Brett’s terse branch is an incremental improvement. He’s changed many of the properties in a Maven POM to XML attributes. In Brett’s terse branch, the dependency declaration shown above turns into this:

    <dependencies>
      <dependency groupId="javax.activation" artifactId="activation" version="1.1"/>
    </dependency>

This is a small change, but a welcome one. Anything that can save keystrokes makes sense as my POM files have grown unwieldy over the past few months. I’m also sick of wasting book pages listing POM after POM. If you’ve ever tried to write a book about Maven, you’ll realize just how insane it is that a tool that professes to follow the “Convention of Configuration” design pattern requires so much configuration to achieve simple results. (From my Editor: “If Maven is so easy, why does it require all of this XML.”) Maybe Brett’s incremental changes are a step in the right direction? Hopefully, we’ll see more innovation in the weeks to come.

While the Maven team has made it abundantly clear that they are not interested in revolutionary changes to the Maven POM, now’s your chance to comment on the proposed format changes. If you have any ideas about how to make POMs less verbose and more readable, leave a comment on this thread.

Shashank Tiwari

AddThis Social Bookmark Button

James Ward and I put together an article on porting over an HTML application to Flex. Its published on InfoQ. We used the Pentaho BI Dashboard as the sample application in our endeavor. After reading the article you will realize the simplicity of the task and the quick gains you could get by making such a move. The source code is available for download and a copy of the final application is accessible online.

James is presenting on the same topic this week at JBoss World, with JBoss JMX Console as the example this time.

Dejan Bosanac

AddThis Social Bookmark Button

Enumerated types (enums) are a way to define fixed set of constants, so helpful in many areas of software development. In the most common case, in your Java code written for Java 5 or newer, you will use enums for int constants and replace chunks of code that look like this

    public static final int DIRECTION_NORTH     = 0;
    public static final int DIRECTION_SOUTH     = 1;
    public static final int DIRECTION_EAST      = 2;
    public static final int DIRECTION_WEST      = 3;

with something like this

public enum Direction {
    NORTH, SOUTH, EAST, WEST;
}

Then, you’ll change method definitions that look like

public void changeDirection(int direction) {
    // do something
}

with something like this

 public void changeDirection(Direction direction) {
    // do something
}

And finally, the method call will be changed too, from

ship.changeDirection(DIRECTION_EAST);

to

ship.changeDirection(Direction.NORTH);

There are a few obvious benefits from using enums over the standard int constants, such as the type safety and namespaces for example.

But we can also use enums to define other types of constants, string constants for example. You can often see examples of using enums to make a switch idiom for strings possible in Java. Take a look at the following example

        String direction = "WEST";
        switch (Direction.valueOf(direction)) {
            case WEST :  System.out.println("Go west!");
                         break;
            case EAST :  System.out.println("Go east!");
                         break;
            default : System.out.println("Go somewhere!");
        }

It prints Go west! as a result which is great.

But in order to be truly useful for string constants purpose, enums needs some extra tuning and here’s why.

Shashank Tiwari

AddThis Social Bookmark Button

Bruce Eckel says Java is at an “Evolutionary Dead End”. His perspective is that retrofitting newer features into Java is making it absurdly complex. He states the choice is between no more evolution or breaking away from the past. In any other scenario he suspects things are only going to get worse. As a passing by remark, he proposes moving on to Scala as an exit strategy, if Java continues to evolve while honoring backward compatibility.

Technically his point is valid, realistically what are the millions of Java developers who build Java applications at thousands of enterprises going to do if they can’t incrementally take advantage of some of the newer features? It may be possible for Ruby or even Python to radically break away from its earlier versions and start on a fresh slate because not only do they have lesser number of deployments but on an average they have programmers smarter than the average corporate journeyman.

Java has evolved from being a replacement for C++ to an all pervasive cross domain programming language. One of the primary reasons for this growth has been the abundance of features, availability of commercial and open source implementations of these features and wrapping up of these features in all sorts of APIs, with the assurance of stability.

If we drop everything and restart, won’t Java be a completely new language? How would we guarantee we get everything right this time around? Which portions of Java will benefit from reinvention the most? What will we do while we are busy reinventing, knowing what we are doing is soon to be rendered obsolete — it won’t get done in a jiffy in any case?

Shashank Tiwari

AddThis Social Bookmark Button

Let me start by wishing everyone a happy new year ! I hope 2008 is prosperous and peaceful for all of you. For many of you who still take pride in being a Java developer, I also put down a list of top 5 expectations from the year that has just started. It may be presumptuous on my part to create a single list of top 5 expectations for the eclectic world of Java developers but none the less I will do it! Some of you will agree, some of you will vehemently disagree and the rest will remain silent. In all the cases though I hope to provoke you to think about what you want and desire from the language and platform that you are so intently connected with.

So let’s get started -

1. JavaFx transforms from hype to reality
In 2007 starting with JavaOne, we all heard that the messiah has arrived in the form of JavaFX. Unfortunately, the entire promise is taking too long to manifest into a real option. Hope 2008 either converts it into a real, simple and viable option, so that Java developers don’t necessarily need to take refuse in the alternative rich interface technologies, or just brings all the hype to an end.

2. Glassfish enters the application server choice bundle.
Glassfish is a fantastic open source Java application server and platform. It was the first one to be compliant with the Java EE 5 standards. It has implemented almost everything that the JCP is churning out. It works and it is powerful. However, it still remains an unknown application server in the enterprise. Most managers have never heard of it, many Java developers have never bothered to download it and many others think its not a serious option, even without checking it out. Hopefully developers start taking its advantage in 2008.

3. Lightweight/Heavyweight discussion is put to rest
With Java EE adopting many of the advantages of frameworks, tools and libraries that figured out how to do things in a simple and straightforward manner, the divide between the so called traditional heavyweight Java and its lightweight alternatives is blurring. However, many of the staunch believers and promoters of the lightweight frameworks are not letting the debate rest to peace. May these folks find something more useful and new to champion ! Also, those who switched sides altogether in favor of those dynamic options, beyond Java, that was supposed to cleanse them of all evil may return once they find that their simple framework fails to deliver simple database manipulations or relies on your same old ways to integrate with other things in the enterprise.

4. Google likes Java, somebody convince Apple too :)
The iPhone is popular and many iPhone applications are being built. So far Java is poison for Apple. Hopefully things change this year. Hopefully Java developers gain from this surge! Google has already helped the world of Java developers with its numerous open Java APIs and services. Its has also reinforced that when the winner adopts you, you flourish and proposer! So its not as much about being with Apple the company but its about being in the winner’s camp.

5. Unify some and sunset a few others
Plurality in the world of Java provides ample choice to do even the most mundane of tasks but it often leaves Java developers confused in the middle of this abundance. Java developers for a few years now spend a considerable amount of time contrasting and comparing the numerous commercial and open source frameworks, tools and libraries to get their job done. Hopefully, 2008 sees some of these projects merging and some others just waning into obscurity. Hopefully the feudal lords realize that although dictatorship is detrimental, a unified nation state has its benefits.

Thats all for now!

Speak up! Say whatever you have to say, its all about what you want:)

Once again, a happy new year!

Robert Cooper

AddThis Social Bookmark Button

Thing are quiet around here for the holidays, so I want to do another post on our Gwittir framework for GWT. In the last post I demonstrated some basic data binding and made a little Flickr browser. I am going to reuse a lot of the same technologies here and show you a little iPhone RSS reader. Yes, I know the GWT team did their own, but this is a nice example to show some of the differences, so you can compare and contrast. I also have a running example up.

I am using ROME on the server side again, this time with the OPML plugin

Robert Cooper

AddThis Social Bookmark Button

At my “day job” at Manheim Auctions we have been using GWT for a while now on “real world” projects. Along the way we have built a lot of tooling for GWT and we are now releasing a big chunk of it as Gwittir (like Glitter with a lisp). There are a number of tools included here, but the real core of it is made up of “lite” version of things you are accustomed to the the larger Java world. Here we will take a look at Beans Binding, and Animation to create a Flickr browser (running example at the link).

I kind of joke that this project is a roll up of a lot of the open source work I have done for the last couple years as it uses ROME and the MediaRSS module and is built with gwt-maven which I have talked about in this space before. You can grab the source for the example here. A long look at the code after the jump.

Robert Cooper

AddThis Social Bookmark Button

In the spirit of Neil and Josh/Will’s Java Puzzlers, here is one I just recently ran into:

Given the following block of code:

        PropertyChangeSupport changes = new PropertyChangeSupport(this);
        PropertyChangeListener l = new PropertyChangeListener(){

            public void propertyChange(PropertyChangeEvent evt) {
                throw new UnsupportedOperationException("Not supported yet.");
            }

        };
        changes.addPropertyChangeListener("foo", l);

        for( PropertyChangeListener remove : changes.getPropertyChangeListeners() ){
            changes.removePropertyChangeListener(remove);
        }

        System.out.println(changes.getPropertyChangeListeners().length);

What will this snippet print:

  1. 0
  2. 1
  3. Throws an Exception
  4. Other

Answer after the jump.

Paul Browne

AddThis Social Bookmark Button

A warning if anybody asks you about your job: the words ‘grabbing people’s brains and shoving them into a PC‘ is not the best explanation. I wouldn’t recommend explaining Rules and RuleFlow to your boss in those terms either. Unless they already think you’re some sort of Frankenstein and your name is Igor.

A better way might be to use the workflow example from the recent Irish Java Technologies conference. It show what Rules and Ruleflow are, in a way that even your boss can understand. And if your boss is the pointy-haired-dilbert-type, they don’t even need a computer to understand it.

The Health services in Bangladesh (like in many countries) can’t get enough doctors. Training more is not a solution ; those that do qualify often leave for better pay elsewhere. Given the desparate need for trained medical staff in rural areas, what are health workers to do?

The solution that the Health workers came up with was IMCI - or Integrated Management of Childhood Illness. It takes what the Knowledge in Doctor’s head’s and captures it as a simple guide that health workers can follow. When a sick child is brought into the remote clinic the health worker is able to follow the simple step-by-step instructions (like the to make quite a sophisticated diagnosis.

I’ve no medical training beyond simple CPR (and if you’re relying on that then you’re in real trouble) but even I can understand it.

imci.jpg

Look at the pale blue box in the diagram above. It’s a set of medical rules: Are there any danger signs? What are the main symptoms? What combination of these symptoms are there? What is the age of the child? How long have they been ill? Depending on the outcome of the rules, go to the next set (the pink / yellow /green) boxes and apply the rules that you find there.

That’s Rules and RuleFlow.

  • Rules are ‘when something is present , then do this’. And not just single rules, but many of them. Together, loads of simple rules allow you to come up with quite a sophisticated diagnosis.

  • Ruleflow allows you to group your rules. If you’re a health worker with a sick child you want to do the most important checks first. Depending on the outcome, you then apply the next set of medical rules: Pink if they need urgent referral to the hospital, yellow if the clinic can cope , or green if the child can be looked after at home.

As gory as it sounds, everybody, including the doctors, are happy that their ‘brains have been put into a PC‘ (or in this case , a set of paper cards). The Doctors are happy because they can (guilt free) move to better paying jobs. The medical workers using the system are happy because they can help the sick children that they see every day. And the children gain because the better availability of medical knowledge (via Rules and RuleFlow) is literally the difference between life and death.

This article was orginally published on the JBoss Drools Blog. Paul also writes on People and Technology, explaining Enterprise Java using Pigeons.

Dejan Bosanac

AddThis Social Bookmark Button

I’ve always loved Groovy builders concept for handling (mostly creating) hierarchical documents. On the other hand I find StAX, pull-based processing API, to be one of my favorite methods for dealing with simple XML processing. It’s simple and fast, so what more can I ask for? Additionally, thanks to the Jettison project you can also use the StAX API to handle JSON documents. So, basically we can use one simple (standard) API to handle both XML and JSON documents in the same manner. The next logical step is to merge these two great pieces of technology into one.

Paul Browne

AddThis Social Bookmark Button

The JBoss Drools boys have something cool brewing. They already have the most useful GWT (Google Web Toolkit) App that I’ve seen outside of the Googleplex. That’s a fully fledged app ready and waiting to be used in anger, not some example widget, or a test case thrown together by somebody playing with the technology. The BRMS app itself, targeted at business / professional users, allows them to catch the knowledge that they have in their heads and share it with the team.

Here’s the problem; If you’re into Rules, you’ve probably already downloaded the BRMS - ( Business Rules management system). If you’re just a casual browser, a cool GWT app it may be, but you’re not going to take the time. Why? Unless you have Tomcat or JBoss 4 ready and waiting on your PC you’re not going to bother (note ; this will work on other application servers like weblogic , with another couple minutes work, but that just proves my point).

In order to make things easy for us lazy people, the nice people at Drools are preparing a standalone BRMS; download , unzip , start and play. That’s presuming you have Java installed. You do have Java installed don’t you? But being lazy, how big a download is too big?

I’m not the best person to answer the question - I’ve already downloaded the (largish - 530mb) Red Hat Developer Studio (now at release candidate 1). So what’s your download speed and how big (small) does the BRMS have to be before you’d consider trying it out?

Answers on a postcard to the JBoss Drool Team.

Dejan Bosanac

AddThis Social Bookmark Button

It all started when I tried to find a solution for customizing an XStream instance for my ActiveMQ XStream message transformer that would be better than currently used (extending a base transformer and providing a custom factory method that will do things like alias, converter, annotation, etc. settings). I wanted an easy solution to configure XStream instance in a Spring xml configuration file used in my application and provide that instance to all beans that need it (message transformer among others).

XStream is a very nice library that I’ve used and written about before, but there is no Spring factory builder that could be used for this purpose. A little googling got me to the OXM framework, a part of Spring WS project.

Dejan Bosanac

AddThis Social Bookmark Button

I definitely think that dynamic languages for Java platform is an important topic. In that context, a Scripting API as a standardized scripting framework has its own role for Java developers. It is definitely a good thing it is included in JDK 6, but the lack of proper support for earlier JDK’s, in my opinion, slows down its wider adoption.

Why is this important? On one side, there are developers that work on “in-house” applications and solutions. Although it may seem that JDK (or JRE) upgrade process in such environments is not a big deal, it is usually a process that is pretty inertial. Many arguments are used in discussions, from compatibility issues and testing needs to “don’t fix it if it ain’t broken”, but also the inertia factor could be often associated to plain laziness.

On other side, you have developers of Java libraries and general-purpose Java applications who try to have user base as wide as possible. In that manner, they usually keep their products either compatible with JDK 1.4 or provide a special “retrotranslated” version of it.

So, it is not hard to see why general scripting support (through JDK 6 exclusive Scripting API) in applications and libraries is not something that we can see on regular basis in Java projects today (especially when there is no official JDK 6 release for OS X yet).

Mike Hendrickson

AddThis Social Bookmark Button

ignitebostonlogo.gif

The Second Ignite Boston is taking place this Thursday, September 6, from 6 to 10pm at Hurricane O’Reillys. If you have already RSVP’d your name is in our list and you will be entered into a drawing for $300 worth of O’Reilly books, and a Free Beer, or drink of your choice. If you have not RSVP’d or if you think a friend or two should join you, send email with your name to IgniteBoston AT oreilly DOT com. The talks are listed below.

    Keynote: Ben Fry - Visualizing Data
    Visualizing large data in a compelling style with tools that scale.

  1. Alessandro Pace - Flash Lite mobile technology
    I would like to showcase how to create Flash Lite content for mobile phones. I would be able to show sample applications
  2. Yael Maguire - New Uses of Long Range RFID
    Agile RFID reader technology.
  3. Jon Orwant - Google Book Search
  4. Ned Gulley - A wiki-like programming contest
    Picture a programming contest that’s open source, fast-paced, and competitive. Addictive collaboration ensues
  5. Andy Gregorowicz - Mining Wikipedia
    An overview of how we mine the Wikipedia to create massive networks of concepts and terms with interesting visuals.
  6. Hari Jayaram - Waiting for the MySpace scientist
    Science is getting so complex that we need to open things up, collaborate and use technology more than ever before
  7. Neil Henry - Digital Image Glut
    Articulation of an unmet need of modern consumers. The scarcity of time to organize, rate and enjoy digital images
  8. Jesse Liberty - Sliverlight
    Learn what is cool with Sliverlight.
  9. Ivan Schneider - A proposal for rules-based payment processing
    Why should affiliates and suppliers wait for a check when the payments network can divvy the spoils for every purchase?
  10. Shava Nerad - Convergence: games, virtual worlds, social networking
    They grew up on their own — now corporations enter. How will they deal with convergence and big money colonialism?
  11. Greg London - Bounty Hunters
    Looking at copyright law as a bounty/reward shows how to set the terms of copyright to some reasonable length.
  12. Michael Burns - Securing the OLPC
    Millions of XOs are being distributed this year. Bitfrost is the system to protect these child users. How does it work?
  13. Matt Douglas - Founder
    Develop a mantra for your product: how we make design decisions at MyPunchbowl.com
  14. Brian Olson - Ending Gerrymandering Through Automatic Redistricting
    Lots of states have crazy congressional districts drawn to the benefit of one party. Let a computer do it fairly!
  15. Daniel Olguin Olguin - Sensible Organizations
    Social sensor network technologies that will help individuals and organizations work better.
  16. Michael Colombo - AIR from the commercial trenches
    Seen enough Web 2.0 mashups? Let’s discuss building a business case, managing, and executing in an Adobe RIA universe.
  17. Ted Gilchrist - Extending Robocal to do “talking driving direcctions”
    Robocal is a talking Google Calendar, that you can call up. Now you’ll get driving directions to your meetings.
  18. Renat Khasanshyn - Enterprise 2.0 and Data Mashups: Bridging the Web 2.0 Information Gap
    In today’s enterprises, most data integration projects never get built. The ROI on these projects is simply too low. Co
  19. Dan Stolts - Free Local Technology Resources
    The local user group community is thriving. Get a taste of what the community is doing for the community.
  20. James Turner - 5 Ways to Keep an Editor Happy
    So, you’d like to write something for the ONLamp Family of Websites? Here’s 5 basic boo-boos to avoid.
  21. Daniel Berube - Storytelling
    As Leader of the BOSFCPUG, I would like to discuss Final Cut Studio 2 as a tool for storytelling and video on the iPhone
  22. Keith Erskine - Launch: Padpaw
    Padpaw is out of the Garage! Padpaw helps your group with important updates and information using your cell phone
  23. Greg Raiz - Launch PicMe Photo Sharing
    PicMe is a desktop based photo sharing application. It allows users to view and share large collections of photos.

Technorati Tags: , , , , , ,

Tim O

AddThis Social Bookmark Button

Wicket graduated from the incubator, or so I’ve heard. I’m never 100% sure of what has or has not graduated. Anyway, unlike a number of widely used open source libraries, Wicket is easy to checkout from source, compile, install, and have running up in Eclipse because it happens to use Maven 2 as a build system. In other words, you don’t have to fish around for instructions on running some byzantine Ant build, it’s all summed up by the following commands:

  • svn co http://svn.apache.org/repos/asf/incubator/wicket/trunk wicket
  • cd wicket
  • mvn install eclipse:eclipse
  • (start eclipse…)
  • (File -> Import -> Existing Projects into Workspace) *don’t click copy, leave ‘em where they are
  • (configure your M2_REPO classpath variable to point to your local repository)

Done - took you maybe 5 minutes start to finish…

And, that’s the way it should be. No need to read some readme file to try to figure out what software needed to be installed, or what other projects need to be in what relative directories, etc…

maven 2 just works.

Update 9:09 PM: Thanks to Mr. Locke for correctly pointing out that I left out the import projects step in the comments.

Dejan Bosanac

AddThis Social Bookmark Button

In software development we are often encouraged to decouple things in order to achieve greater flexibility in our code. So we decouple model objects from views, interfaces from their implementation, etc.

Here, I would like to write about different kind of decoupling, front-end from back-end. In many cases, projects tend to depend on resources that are either unreliable or overloaded. For example, besides your “main” database, you may need to write data to some LDAP server that is overloaded or you need to provide some data to the resources over the unreliable network connection. In most of these use cases, these operations are triggered by users through the user interface (web or stand-alone application). It is totally unnecessary (and usually unacceptable) to have your users wait a few minutes for operation to complete or in worse case to have dysfunctional system just because one resource is unavailable.

Shashank Tiwari

AddThis Social Bookmark Button

JBoss Seam and Adobe Flex are two promising technologies. Seam makes it easy to build stateful web applications. It integrates the Java EE frameworks together. Flex is a great rich application development framework. The question is can they and should they be used together?

Seam till its 1.x versions used JSF as the main UI framework. This implied that it was built around a server side UI model. Flex on the contrary is a client side UI framework. Oops! so we have a big disconnect right away! Not really, there possibly are some viable options to make them work together. In the latest version of Seam 2.0.0 BETA the coupling with JSF has been loosened. Also, in the past its been demonstrated that JavaScript UIs (built on frameworks like DOJO or any other) could directly remote to Seam server side components. Remember though that JavaScript runs within the browser whereas Flex applications runs within the Flash VM. Does that matter?One option is to have Flex as the front end and make Flex components remote to Seam? Technically this is a possibility and may be good in situations where Flex is used as a pure view description technology. In fact has anybody wondered writing a JSF render kit for Flex? That would be one nice looking but ugly under the hood hack. The state and event management would be all mixed up and one would end up writing more wiring to save the two together than use in isolation. I know some of you may oppose this thought and may cite cases where you have used Applets as a face for Servlets or similar server side technologies. Yes it works, is it elegant though? And what were the big wins of making them work together anyway? This the same question I ask when I read articles that claim that Spring MVC can work smoothly with Flex and Java Portlets can work effortlessly with Flex. Is it better to make complicated applications by spending more time and energy as opposed to building clean applications faster? In other words is it better to do the right thing or focus on making everyone happy?

So what does it mean in the context of our main exploration of making Seam and Flex work together? We have looked at the dry option of remoting a Flex face to a Seam server side. We could possibly liven it up by managing state on both sides - client and server - and introduce something that could be called a State Transfer Object (STO) to transfer the state information back and forth. Doesn’t sound good! It reminds me of the pain of using DTOs. Is there any other option? My answer is that I don’t know of one yet. I am trying to write a bridge between the two, following the principle of delegation and inclusion of common contexts wherever possible and ofcourse cheating (oh sorry! drawing inspiration) from the JavaScript remoting integration and the GWT integration in the Seam code base. If and when its ready, it would show up as an open source tool for everybody to play with and I will annouce its arrival. BTW, if anyone else here is interested in hacking that with me, you are most welcome to join in. In the meanwhile I would certainly like to hear your experiences in making these two work together. Both real life experiences and armchair musing are welcome.

Dejan Bosanac

AddThis Social Bookmark Button

If you build an application that integrates ActiveMQ broker, it makes sense that you want to integrate its web console as well. It provides your users with basic monitoring and management operations. One road you can take is to integrate it as a WAR archive, but as you already have a whole lot of ActiveMQ integrated, you probably want to include just necessary subset of libraries and files and always have most up to date version of it.

This integrations is not as seamless as it probably should be, but here are a couple of steps I found do the job for me (and hope can help someone else with the same requirements). I use Maven2 as a build tool and its assembly plugin to create a final distribution. If you are using some different building environment it is probably the best to stick with customized WAR archive.

Tim O

AddThis Social Bookmark Button

Those of you familiar with Swing may have noticed an error in the last post. This is a correction to First Steps “Hello OnJava”.

On the JavaFX users mailing list Dean Iverson pointed out that the intermittent exceptions at startup where most likely due to the fact that I wasn’t using SwingUtilities.invokeLater(). Here’s the text of his reply:

When I see intermittent exceptions at startup, the first thing I think of is manipulating components off of the EDT. I see from your code that you are creating your frame, running your script, and setting the frame visible from the app’s main thread. The first thing I would try is to wrap that stuff in a Runnable and use SwingUtils.invokeLater.

Right, right, it’s been so long since I’ve picked up Swing I forgot about this. But, this makes perfect sense, part of the promise of JavaFX is that it is going to convince programmers like myself to reconsider Java GUI programming. Hopefully following the series will help others in the same situation.

Read more to see the modified Main.java from the previous post…

Tim O

AddThis Social Bookmark Button

This entry is just an attempt to start rolling something useful with JavaFX. I wanted to create a simple list of the most recent blog entries on OnJava using JavaFX. Starting simple, I wrote a very simple JavaFX application that parses the OnJava ATOM feed and just draws an array JavaFX Script Groups containing a Rect an two Text nodes.

Impressions after a few days

Pay attention to this technology. It’s at a very early stage, but, from what I see if could become very useful, very quickly with some minor improvements. It is very easy to dismiss JavaFX as hype, or to say that Sun will never compete with Adobe’s Flex, but I’m less interested in the horse race and more interested in the technology. While there are a few people out there blogging about initial experiences with JavaFX coding, the vast majority of commentary on JavaFX is being written by developers who haven’t bothered to use it. I’m not going to render judgement on this technology for another few weeks. In the meantime, I’m going to get involved, get my hands on the technology and use it.

  • A little buggy? Anyone else having issues running a JavaFX script via the ScriptEngine? I’m getting concurrent modification exceptions every other time I try to run this application from NetBeans 6. Either I’m doing something terribly wrong or the JavaFX runtime is an early stage alpha. Update: JavaFX isn’t buggy as I had previously suggested. Any exceptions that were being thrown were a problem in my Main class. I was trying to execute the FX script in the EDT. For an update to this post, read Correcting a Swing Mistake.
  • Not nearly as capable as Adobe Flex, but I can see the potential for easier integration with existing Java libraries.
First, a Disclaimer

JavaFX is so new there’s little documentation. (Actually that’s not fair, there’s a good deal of reference and some tutorials, but there is very little “here’s how you do X” documentation yet.) I’ve assembled a sample JavaFX application that includes a JavaFX component as a JComponent in a Swing application, but don’t view this application as a blueprint for your own application. There’s a good reason this isn’t an article - it is not a tutorial but my attempt to capture the first few hours of my experience with the technology. (Read: experimental)

Now on to the code…
Tim O

AddThis Social Bookmark Button

JavaOne is likely the single largest developer-focused conference that exists, and it is conference week once again. I’ll be in San Francisco for three days this week tracking people down and asking your questions. Here are some of my own:

  • How is Sun doing under the leadership of Schwartz? Are the economics of Sun improving?
  • Last year, Sun tried to emphasize participation in the JCP? Did that emphasis pay off?
  • What does the GPL really mean for Java?
  • Obligatory questions about Apache Harmony and the TCK license.
  • What is this “Project Flair”? Supposedly it is Sun’s answer to Silverlight and Apollo? Is it hype or substance? Is there anything interesting behind F3?
  • Lastly, this is the first year I’m actually going to give NetBeans and Glassfish a chance.

Please take some time to list your questions for this years JavaOne, and I’ll do my best to track down some answers. Stay tuned to the O’Reilly Network and to java.net for ongoing coverage.

Disclaimer: I’m going to delete long comments (more than a paragraph or two). Not looking for essays in the comment threads.

Tim O

AddThis Social Bookmark Button

Steve Loughran’s Ant in Action is an upcoming book to pay attention to. Why? I don’t have numbers, but i wouldn’t be surprised if a majority of Java programmers still use Ant every single day. Steve blogged about the upcoming book 4 days ago, but a few things caught my attention:

  1. “Libraries are managed with Ivy 1.4.1. Pulling down artifacts, sharing across projects.”
  2. I’ve chosen Luntbuild over CruiseControl for the continous integration server. CruiseControl is a very high-touch tool, and it doesn’t let me chain work across projects the way Luntbuild, Bamboo and the like can do.”
  3. Deployment with SmartFrog. We look at how to do do a complete deployment of database, app server and applications, with JDBC driver installation and all the other details needed to bring up a full functional application server.”
  4. “imports, macros, and presets”

New Stuff: Some links

  1. Luntbuild - automates builds, used to achieve continuous integration. an alternative to CruiseControl and Continuum. There is a free version, but there is also a professional version.
  2. SmartFrog - A project from Hewlett Packard Labs in Bristol, UK. configuration, distribution, and ignition (see below)
  3. Ivy (now in the Apache Incubator) - Ivy is a “dependency manager”. It will bring something like Maven’s dependency management to an Ant build (but it also isn’t Ant specific). you define your There is also an Ivy Repository which contains Ivy XML files that describe a software artifact and its dependencies (example Commons HttpClient 3.0)
Tim O

AddThis Social Bookmark Button

Seam adoption rate

Gavin King notices an uptick in Seam adoption rates:

Until recently, they had been tracking pretty much level - Seam downloads had been growing slightly slower than Hibernate downloads did, about one month behind. But recently, the downloads jumped up, and Seam after 18 months is now where Hibernate was after almost 2 years. So, for now, we are doing better than Hibernate did.

One programmer’s Velocity vs. FreeMarker comparison

In (older news), also on the Hibernate team blog, read this interesting comparison of Velocity vs. FreeMarker, while this is from last February, it’s a summary comparison of one programmer’s experience with Velocity and FreeMarker.

JRuby News: ActiveRecord Fully Supported, JRuby nearing 1.0

Charles Nutter updates us on the progress toward a JRuby 1.0 release expected “within the next several weeks”.

Also over at Charles Nutter’s blog is a status update on JRuby ActiveRecord support, and performance. Summary, ActiveRecord is 100% implemented and there are zero test failures against MySQL. The JRuby folks have seen a doubling of performance benchmarks in the last month.

Shashank Tiwari

AddThis Social Bookmark Button

The desktop transformed user experience through the last 20 years and has been the entry point for applications for a long time now. Come to think of it, even the browser is an application that resides in the desktops of users. The browser helps us access sites that run applications and that may be an aggregation itself, like a portal. The web applications, which traditionally were database centric and form, based data entry and reporting, email and ecommerce type applications are maturing into online office and collaboration applications (the offerings from Google), online gaming and online drawing applications (Gliffy). Interestingly enough though, the desktop has not changed fundamentally in its many years of existence and is still focused on file management, document creation and deletion, and local storage of documents type of functionality. Of course there has been the inclusion of web technologies into the desktops. More recently, Microsoft and Adobe (with its Adobe Apollo) may be examples of companies that are bringing the concepts and technologies of the web to the desktop. An important question then is, what is the future of the desktop and that of the web? Would the desktop be replaced by the web or would the web pervade throughout the desktop? These and related ideas were brought-up by David Temkin (www.davidtemkin.com), the co-founder and CTO of Laszlo Systems as a part of his presentation at the AjaxWorld in New York. David seemed very bullish about the web outperforming the desktop in being the center of user experience in the long run. Guess that is why, Laszlo is taking the desktop to the web with its Webtop offering and betting on it being a preferred solution going forward. Of course they are not the only ones doing it neither are they the first to do it. Laszlo Webtop is a solution that provides the infrastructure to build a web-desktop or a “webtop”. It leverages Java on the server side and is built to take advantage of the established server side java frameworks and mechanisms. (I tried the initial release of this product and maybe would talk about it sometime later or try and compare and contrast it with similar offerings from other vendors.)

Now we are not sure if the Laszlo Webtop is the winner in the long run and I am not trying to present David Temkin’s presentation verbatim here, but I think the questions he has raised and his opinion on the matter are indeed something for us to ponder about. Considering that java developers may still be struggling between old Apache Struts type web frameworks and the numerous hybrid choices that AJAX/RIA have presented to them, are they thinking about where the web-desktop convergence is going and the role they want to play in shaping this convergence’s destiny. Or is it that some of us are happy that such concepts could theoretically be partially or fully implemented as Applets even some 10 years back. Or is it that we are waiting for a JSR to be initiated for such a purpose :)

Paul Browne

AddThis Social Bookmark Button

Lost in the hype around Service Orientated Architecture (SOA) is the fact that the idea is really really simple. It’s all based on the idea that most applications (and that includes websites) are built either to be used by people , or used by computers. The pictures below (a free preview from the Enterprise Java Briefing) show what I mean.

In a ‘normal’ application, such as a online banking website, we need to remember what the user did last (are they logged in, what account are they looking at, are they in the middle of making a payment). If we didn’t , the user would get annoyed about having to repeat themselves every step of the way. It would also make for pretty complicated screens, to allow the user to enter all the information in one go. Instead , we allow the user to enter information in several steps, and remember where there are each time.

Soa Client

In an application designed to be used by computers, we don’t have to worry about this. We can force the computer to give us all the information required all in one go - username , password, bank account to take money from , bank account to give money to, date to execute transaction. For a computer , this is actually easier ; we make one call to our banking service and we are told it has succeeded or failed. It’s also easier for us to build our service:

  • Each service (transfer money, book flight , execute share trade) only does one thing.
  • Because each service ‘forgets’ after each call, we don’t need to worry about trying to remember what we were doing before.
  • Because we have no memory, services are very scalable; we can make several copies of the same service and put them in a pool. Any client can talk to any service - no waiting for a particular server to become available.

Soa Service

So that’s Service Orientated Architecture (SOA) : programs that do one thing (a bit like a function call to a method) exposed that other computers can call. So what’s the big deal? Like all good ideas , a simple concept goes a long way.

Take a look at the picture below. It’s like a Visio diagram, but in fact it’s drawn by the Eclipse Based JBoss IDE. It shows a workflow for an online commerce store - pretty easy to understand. This example uses JBoss Java Business Process Managment (jBPM), but companies such Tibco, Cape clear and Oracle BPEL have similar products.

soa workflow

Here’s the clever bit; each of these steps is executed by one of the services that we talked about earlier. This means that if the business process changes (and it will), then all you have to do is re-arrange the diagram ; little or no coding changes should be required.

This abilility to mix , match, combine and remix services leads us to a lot of other good things (and we’re only scratching the surface here).

  • Because our services don’t have to run on the same machine, we can use SOA to create a distributed application. This is the concept behind the BPEL (Business PRocess Engineering Language)
  • Services tie well to Ajax and Web 2: Our Ajax web page or portlet can call as many services as it requires to get the job done (it’s one of the reasons Tibcom is sponsoring the open source DWR project)
  • We can call many services at once. If these this service calls are xml based ,or we send these calls as a message then we can filter, duplicate, pass and other distribute these calls as we set. These are the ideas behind Apache Synapse, Apache Servicemix and the Enterprise Service bus (ESB) in general.

What do you think? Is SOA useful , or over hyped?

Robert Cooper

AddThis Social Bookmark Button

Josh held the premiere session for AB5k Tue at Java Posse Roundup (I will post a summary of the week soon). Since there is some discussion going on, including our getting panned at JavaLobby, I thought I would write up a little bit about how the desklet runner system works.

.desklet files are, simply, JAR files. Inside the META-INF folder you place a desklet.xml file that looks something like this:


<?xml version="1.0" encoding="UTF-8"?>
<desklet version="0.1">
    <name>ROME Reader</name>
    <author>Robert Cooper</author>
    <homepage>http://www.screaming-penguin.com</homepage>
    <description>An RSS/Atom Feed Reader</description>
    <class>com.totsp.desklet.rome.RomeDesklet</class>
    <repository>http://myserver/repo</repository>
    <dependency>
        <groupId>jtidy</groupId>
        <artifactId>jtidy</artifactId>
        <version>8.0-20060801.131059-3</version>
    </dependency>
    <dependency>
        <groupId>rome</groupId>
        <artifactId>rome</artifactId>
        <version>0.9</version>
    </dependency>
    <dependency>
        <groupId>jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>FlyingSaucer</groupId>
        <artifactId>core-renderer</artifactId>
        <version>R6</version>
    </dependency>
    <dependency>
        <groupId>FlyingSaucer</groupId>
        <artifactId>cssparser</artifactId>
        <version>0.9.4</version>
    </dependency>
</desklet>

Most of the stuff at the top is pretty straightforward. The big thing here is the dependency management. There are a number of ways you can specify deps for your desklet. The recommended way is to specify them in the desklet file, alternately specifying a repository in Maven 1 layout (M2 will be supported soon), and declare the dependencies in your desklet.xml file. When your desklet is installed the required dependencies will be downloaded and put into a shared repository. The reason this is the best tact is downloaded dependencies are put into a shared repository and are not re-downloaded for each desklet, improving the user experience, and reducing desklet size.

Another option is to place the dependencies in the META-INF/lib folder in a Maven 1 repository directory structure. That is, META-INF/lib/[groupId]/jars/[artifactId]-[version].jar. Jars packaged in this manner will take precedent over the local repository. This can be useful if you want to ensure for security or other reasons that the exact version of the Jar you want will be used with your desklet.

The final way you can package dependencies is to simply place Jars you need into the META-INF/lib folder directly. These jars will be in place for your desklet, but do not have to be declared in the desklet file. This is a convenience, and can be useful if you have Jars that are not deployed to a Maven repository. However, please keep in mind your desklet files can become large when you do this.

That is all for now. You can expect Josh to be posting information on the specifics of writing desklets this weekend. I will also post information about security and runtime of desklets later this weekend. Also, please keep in mind that between now and JavaOne a lot is expected to change.

Paul Browne

AddThis Social Bookmark Button

I been asked to spec an ‘Advanced Java’ training course. The list (below) contains a couple of ideas of what should be on such a course but ‘Advanced Java’ means different things to different people. Over the many years you’ve spent with Java, you’ve specialised - partly out of what interests you, and partly out of the work that’s been available.

So the question is: What do you think an Advanced Java training course should contain?.

I’ll narrow it down it bit - it’s got to be stuff that’s mainstream or almost mainstream (however much I’d like to cover JavaSpaces). It’s not dogmatic - i.e. it’s not the ‘Enterprise Java and nothing else’ that was common a couple of years back. But it does have to be of interest / of a level for people coding Java for 3 years or more , and who want to push their skills to the next level. (I also suspect that I’m going to learn as much from them on this course).

Just as important, why do you think [insert topic here] should be included on the course? Leave a comment.

Current Menu of Topics (Full Course description here)

(this list is an early draft , so I’m prepared for some glaring omissions!)

  • Aspect Orientated programming
  • Spring Framework
  • Hibernate
  • Ruby , JRuby and other scripting languages in the JVM
  • Java and .Net (C# , VB.net) interoperability
  • Struts 2 Web Toolkit
  • Agile Programming , Junit and Fitnesse
  • Java , Web and Ajax
  • Business Rules and Rule Engines
  • Workflow and Business Process Engineering Language (BPEL)
  • Search in Java Applications - using Google and Apache Lucene
  • Enterprise Service Bus
  • Service Orientated Architecture.
  • Eclipse Advanced features (also WSAD - IBM / JBoss IDE)
  • JDeveloper Advanced Features
  • JMS & Messaging
  • Introduction to Architecture and design patterns
  • JSF - Java Server Faces and Oracle ADF , Apache MyFaces
  • Apache Tomcat and Jboss
    Advanced Features.
  • Google Web Toolkit
  • Maintaining older systems
  • Refactoring
  • Agents
  • Web Services
  • What’s new in Java 5
  • What’s new in EJB 3
  • Key Java Open Source Projects
  • Server side Java for Mobile Solutions

What am I missing? What should I delete? Let me know.

Paul , Technology in Plain English

Robert Cooper

AddThis Social Bookmark Button

Bruce from the Red Pill team at Google spoke to the Atlanta Java User’s Group tonight and a question came up that I feel is important:

Q: I work for a guvment website, and we are forbidden by policy from using cookies. How do I maintain auth in my GWT web service.

A: The easy answer is to use a Dictionary class.

The Dictionary class is part of the i18n GWT package, but the big advantage it has is that it is resolved at runtime, rather than compile time. This means you can pass in values to your GWT app from the host page. In this case, the host page being a JSP.

What you want to do is create a script tag in a host JSP like this:

   var services = {
        service1 : "<%=response.encodeUrl( "[serviceURL1]") %>",
        service2 : "<%=response.encodeUrl( "[serviceURL2]") %>"
   }

That means you can now use :

Dictionary services = Dictionary.getDictionary("services")

to get a lookup for your service URLs with JSessionID encoded and use that when you construct your stubs. This will give the service cals the same JSessionID as your JSP host page.

Dejan Bosanac

AddThis Social Bookmark Button

Probably the first design pattern that every software developer learns is Singleton and lazy loading of Singleton classes.

The usual example, goes something like this:

public class Singleton {

 static Singleton instance;

  public static synchronized Singleton getInstance() {
    if (instance == null)
      instance = new Singleton();
    return instance;
  }

}

The problem with this solution is that synchronized method getInstance() is called every time, while synchronization is actually needed only for the first call of the method (which introduces performance overhead in your application). There were attempts to tackle this problem by using Double-checked locking pattern, which although great in theory didn’t work in practice.

Today, thanks to Bob Lee, I found out that there is a solution to this problem that is both simple and fast: Initialization on Demand Holder (IODH) idiom. The appropriate example follows:

public class Singleton {

  static class SingletonHolder {
    static Singleton instance = new Singleton();
  }

  public static Singleton getInstance() {
    return SingletonHolder.instance;
  }

}

Basicaly, Java Language Specification (JLS) guarantees that instance would not be initialized until someone calls getInstance() method (more information could be found in articles that I’ve linked to before). Elegant and fast, just as it should be.

Hari K. Gottipati

AddThis Social Bookmark Button

Google is looking at Java based online office suite despite of having Docs & Spreadsheets!

Computerworld reviewed online office suites Ajax13, Google Docs & Spreadsheets, ThinkFree Office Online and Zoho Office Suite . The winner is ThinkFree and the runner is Zoho, same as I mentioned in my previous blog Google is not the leader in Ajax applications.

The reason to pick ThinkFree was:

It looks more like a full application: menus, a rich toolbar, a ruler bar and even a drawing toolbar similar to Word’s for inserting elements such as AutoShapes, text boxes, clip art, and pictures.
In fact, ThinkFree’s Power Edit menu reveals a startling number of word processing features, from columns and drop caps to AutoCorrect and table manipulation, such as merging cells, distributing cells evenly across the page, repeating header rows.
ThinkFree hides your browser’s menu bar, so when you use familiar keyboard shortcuts (such as Alt+F, O for File/Open), you are operating within the ThinkFree interface, not your browser. Other similarities to Microsoft Office are downright eerie — the charting wizard in ThinkFree Calc looks just like Excel’s and supports all of Excel’s chart types.

Think free offers their word processor in two flavors: Quick Edit and Power Edit. Quick edit is Ajax version of the editor which offers a minimal interface — a few toolbar buttons for simple editing and some other features. All above features(listed in block quote) are only available in Power mode which is Java(applet) based. They used Java for more complex functions and for deeper Microsoft compatibility. However, initially the Power Edit takes time to load as it has to download the applet.
So the question is, why can’t they support all Power Edit(Java) features in Quick Edit(Ajax)? According to ThinkFree CEO TJ Kang:

Currently the best way to offer advanced Web Office functionality is to utilize Java. Ajax doesn’t cut it when it comes to advanced functionality. Although in theory you can build it in Ajax, the resulting code will be so big that it will take ages to download stuff and slow the system considerably. So Java is, much more efficient than Ajax when it comes to implementing Microsoft Office-like functionality.

Since they have both Ajax and Java versions, I don’t think his comments are biased towards Java. At the same time don’t forget that initial download time of an Applet is significant and browser needs a Java plugin.

In other prospective, Google is not in the top 2 list of the online office products, because:

High-end documents don’t render properly because Google Docs isn’t 100% Word-compatible, nor does it claim to be.
Google Spreadsheets has a few compatibility issues with Excel (array formulas aren’t supported, for example), and its lack of charting support is a disappointment.
However, even Google Inc. may be ready to admit that its office applications aren’t ready to take on Microsoft.

For Google, its clear that it cannot compete with the Microsoft with its Docs & Spreadsheets. Unless they support all MS office features, it’s difficult for Google to win the race. Perhaps, it’s difficult for them to support all the functionality and MS office compatibility with their current approach(Ajax). So here are the options for Google to win the race:
1. Support all the functionality with Ajax even though the resultant code is going to be big and ages to download
2. Despite of initial download time, rewrite online office suite utilizing Java .
3. Buy ThinkFree

Guys, what you think? Based on Google’s recent acquisitions, do you think that their option will be 3? You are right, they are already in talks with ThinkFree.

Google is reportedly in talks with a South Korean software company and its US subsidiary ThinkFree, which makes browser-based office productivity software compatible with Microsoft file formats.
ThinkFree is a subsidiary of Haansoft, which is based in Seoul. Haansoft’s CEO, Baek Jong-jin, said he met twice this month with Google’s corporate development team responsible for the $1.65 billion acquisition of YouTube, the English-language newspaper Korea Times reported on Sunday.

I think definitely this move is adding fuel to the ThinkFree’s Java approach. But I believe both have advantages & disadvantages and it depends on what functionality you are trying to achieve it. For example, Java makes life easier to do image handling and animations. On the other hand, ajax is much faster and no plugin is needed. So if your web app is going to have much advanced features such as image handling etc. definitely Java is more efficient than Ajax.

What do you think? Do you agree with ThinkFree CEO TJ Kang? Do you think Google realized that they cannot achieve the advanced functionality with Ajax? Or do you think they are talking with ThinkFree as a part of their acquisition strategy? If you know any Java apps that are powerful than Ajax apps, please add in comments.

Update 1: Fellow blogger Paul Browne wrote ‘Do Google Spreadsheets mean the end of Java?‘. Please do remember that he is talking about the server side Java and I am talking about the client side Java(Applets).
Update 2: Trimmed the title as per Tim’s suggestion. Thank you Tim.

Dejan Bosanac

AddThis Social Bookmark Button

Update: Solution presented in this post is integrated in XStream 1.2.2 and you are advised to use the official (and maintained) release. See this post for more information.

It seems that JSON vs. XML debate was one of the hot topics for this winter. Again, I think that “vs.” part is sufficient and that both XML and JSON should have their place in overall technology landscape. One of the obvious JSON advantages is that it can be directly evaluated in JavaScript. And for the Ajax-world we live in, it is not a small thing.

For one project, I started looking for a library that would enable me easy transformations between Java and JSON data. JSON in Java looks nice, but what I really want is a more automated and configurable library like those we have for XML processing. My first thought was XStream since I like its simple API, extensible architecture, powerful converters and support for annotations. After first check I found that from version 1.2 on there is a partial support for JSON (which was logical thing to expect). So, currently you can serialize your Java objects to JSON format.

AddThis Social Bookmark Button

The Semantic Web is a web of data. There is lots of data we all use every day, and its not part of the web. I can see my bank statements on the web, and my photographs, and I can see my appointments in a calendar. But can I see my photos in a calendar to see what I was doing when I took them? Can I see bank statement lines in a calendar?

Why not? Because we don’t have a web of data. Because data is controlled by applications, and each application keeps it to itself.

The Semantic Web is about two things. It is about common formats for interchange of data, where on the original Web we only had interchange of documents. Also it is about language for recording how the data relates to real world objects. That allows a person, or a machine, to start off in one database, and then move through an unending set of databases which are connected not by wires but by being about the same thing
More Details in W3C

Links:
Spring Resources and Articles
Struts Tutorials and Articles

Paul Browne

AddThis Social Bookmark Button

On a recent client project, we ended writing more than 300 business rules to reflect some of the financial decision making that they applied to an application (excuse me if I’m being suitably vauge with this). Many of these rules would be shared across applications. The rules engine used was the Java based JBoss rules engine (formerly known as Drools).

Obviously , these rules need to be stored somewhere. Most large organisations are comfortable with the idea of using a Database such as Oracle or Sql-Server to carry out this task. This article , for version 2 of Drools but also applicable to the latest release, shows you how to use a database to store your business rules.

More in Technology in Plain English

Tim O

AddThis Social Bookmark Button

There was recently an article that Steve Anglin linked to touting Java’s performance on Windows Vista. Toward the end of the article, the author mentioned that the platform of choice for Vista is going to be the soon to be released Java 1.6. 1.5 will also be supported on Vista (it will work), and the article said the 1.4 will work, but it’s not a big priority. On Macs, there’s a whole different calculus of which version of Java to use because anything lower than 10.4 will not support 1.5. Without getting into the details about the installed user base, and the economics of the particular business application I’m building i tell you the decision tree I went through to chose the base level VM version for a client application that needs to be released in the middle of ‘07:

* 1.6 was ruled out, it’s too risky. I mean that’s not to say that it isn’t something that will work out of the gates, but I tend to give Sun a few months to work out the kinks in any new VM release. Plus, I can’t expect to dictate that people upgrade to 1.6 when I’m not sure what sort of support 1.6 will have on existing platforms. Again, this isn’t FUD (you Sun employees don’t need to start a flamewar). But, 1.6 is not the right choice for a widely distributed retail client application yet.

* 1.4 was ruled out, it’s likely to see support end in the next two years (my assumption). Plus, it’s going to work on Windows Vista, but I’m going to have to expect that the support of 1.4 is going to stop sooner rather than later. Plus, how old is 1.4 now? Many years. From a business perspective, building on 1.4 is somewhat risky because of what I read on that Vista blog entry - people at Sun are not focused on getting 1.4 to work on Vista, if it isn’t getting the same level of attention, it’s more likely to be something that will remain unpatched when 1.6 and 1.5 are the priorities.

* 1.5 was selected. It is going to work on everything OSX 10.4 and up, it’s going to work on (at least) Windows XP and up. It is sufficiently mature and stable. and, the real reason…. I can’t program without both annotations and generics. Plus, all the fancy stuff I want to write about uses 1.5 anyway.

The only place I could see myself using 1.6 is in a server-side application that needed the new support for dynamic languages. In that case, I’m not sending bytecode out into the wild, and I have full control over the operating environment.

Share your own thoughts and experiences?

Please post a comment if you have your own thoughts on this. Especially if you have any “inside” knowledge of support plans. :-) It would be interesting for everybody to see what the current thinking is on which version people are building applications for? I’ve assumed 1.4 and up, but I’m sure there are still people doing battle with 1.2, out there.

Dejan Bosanac

AddThis Social Bookmark Button

As you probably know, Jetty is a web server (and servlet container) written purely in Java. Because it is small, fast and has a well designed configuration API it is often used as a embedded server in various Java applications (Continuum, FishEye, …).

Of course, when you use Jetty in a Spring-based application, you will want to configure it as you configure the rest of your application (as a Spring bean). Since it has a well defined configuration API, this is not a problem to achieve.

Dejan Bosanac

AddThis Social Bookmark Button

Some time ago I needed a unique identifier generator that will look up a value in a simple name-value kind of database table. Project’s database layer was based on Hibernate2 and since I couldn’t find such a solution I have implemented a MultiTableGenerator which I have blogged about here.

The project was finished and I moved on. Since then, many people reported that my solution was not compatible with Hibernate3 but unfortunately I never found time to fix it. Luckily, I was recently reported that Hibernate team introduced this functionality in Hibernate3. The class is called org.hibernate.id.MultipleHiLoPerTableGenerator. As I can see, it is not documented in the latest version of the reference documentation yet, but you can find a description in a JavaDoc documentation.

The configuration syntax of these two solutions looks similar (parameter names have been changed), which makes it even easier to port functionality if you are migrating to Hibernate3. It is good to see useful stuff becoming a standard part of the library.

Norbert Ehreke

AddThis Social Bookmark Button

The notion of bahavioral completeness as introduced with the Naked Objects approach comes across as a two-sided coin, at least to me. After taking note of Eitan Suez’ JMatter framework, I started cross-reading the book Naked Objects by Richard Pawson and Robert Mathews that can be found online. The core concept is a strict interpretation of object oriented methodology in a way such that every action that can be taken with a certain object must be defined within the boundaries of that object definition. The object must be behaviorally complete. This philosophy is in sync with the idea, that a software should display the internal model as closely to the user in its GUI as possible, which I agree with.

Shashank Tiwari

AddThis Social Bookmark Button

An open source project called Restlet is creating what is called a Restlet API as an alternative to the Servlet API to adopt REST (Representational State Transfer) with Java. The belief is that the Servlet API does not have a clear separation of concerns between the transport protocol and the application. The Servlet API is an object-oriented view on top of the Http request/response model. On the other hand, the REST perspective has a resource-oriented view. What this means is that domain concepts are resources which can be referenced with a URI and which can be manipulated by components. The representational state of resources, and not resources themselves, is what is exchanged and connectors provide a means for communication of these representations between components. This also alludes to the redundancy in separation of web components as clients and servers. They could simultaneously be both.

1060 NetKernel is another interesting REST and Java project. It is a REST based microkernel and application server.

Looking at these initiatives, the questions then are:
Is the object-oriented view non-optimal for the web?
Does Java need new definitions for REST?

If you are not already familiar with REST, then read Roy Thomas Fielding’s dissertation at http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

Tim O

AddThis Social Bookmark Button

I started the Maven Registry merely as a personal tool, I just needed a better way to search the Maven repository, and the result became an unpolished web application which gets a fair amount of daily traffic (about 1k searches/day). Maven Registry is a stop gap solution, the repository parsing scripts are written in Ruby on Rails so the sytem doesn’t benefit from the libraries that the Maven project is producing that read a POM and take care of interpolating and ineriting values from POMs that extend other POMs. Plus, it is a one man effort, I *could* make Maven registry an open source project, but, honestly, I’m more interested in reaping the benefits of the Maven Repository Manager (MRM) which is now being refered to as Archiva. In other words, Maven Registry is a useful little tool, but, eventually, you should be using Archiva to search the repository, and when i see that Archiva is ready and that someone has created a derivative that allows for public searching, Maven Registry will be no more.

If you have a Maven repository on your local filesystem, and you are interested in directions for taking a prerelease version of Archiva for a test drive, read on.

Dejan Bosanac

AddThis Social Bookmark Button

First of all, I never use Jakarta Commons Logging (JCL) directly in my applications (Log4J is my tool of choice for logging tasks), but as you probably know many frameworks and libraries do all of their logging through JCL. In most cases you will want to catch some of these log messages, so that you can better monitor your application. For example, you will probably want to log all SQL queries that Hibernate issues, at least in the early development phase, so that you can have a better perspective of what is going on.

I usually don’t have a problem with JCL since it finds a Log4J implementation in the classpath, get my configuration and all works fine. Except when it doesn’t.

In this particulair case, I had a Spring-Hibernate based web application that I needed to deploy on the Tomcat 5 server. After deploying an application, commons logging couldn’t find a log4j implemantation and all logs were redirected to the standard Tomcat log file.

Hari K. Gottipati

AddThis Social Bookmark Button

NetBeans Program Transformation tool Jackpot is a extendable refactoring/reengineering module developed based on Sun Laboratories research project where James Gosling involved. More than a traditional refactoring tool, its a platform library for easily finding and correcting patterns in Java source code using static analysis. From the project description:

Jackpot is a NetBeans IDE module for modeling, querying and transforming Java source files. Although the Jackpot engine can be used for bug detection or refactoring, the initial focus of this module is to add program transformation capabilities for NetBeans users.

Isn’t it same as Refactoring?
In Jackpot context, Program Transformation is a script or Java class which queries sources in Java projects for patterns and changes them. This sounds a lot like a refactoring, but from project description:

Paul Browne

AddThis Social Bookmark Button

Java 5 (also known as Java 1.5) was a fairly major release that makes using Java a lot quicker , easier and cleaner (click here for a full list of the new features, including Meta-Data , concurrency, Generic Types, Profiling , integrated JMX Admin facilities and XML support as part of the java core.).

The problem is that a lot of Application Servers still require the previous (1.4) Version. Even if you’re running on a Server (such as JBoss) that does fully support Java 5, the chances are upgrading an existing application will take a lot of time , mainly in testing effort to make sure nothing has broken. As Java matures, running on older versions will become more and more of an issue.

So, how do you get the benefit of the latest features , without losing the known stability of the previous version? One solution is Retroweaver which allows you to write in Java 5, and deploy in Java 1.4.

(Thanks to Joe Walker’s Blog (Him of DWR fame) for putting me on to this one). More in
Technology in Plain English

Tim O

AddThis Social Bookmark Button

I only have access to the Java blog system, but this message is sufficiently critical to bear mentioning on this channel. So, pardon the off topic post fellow Java programmers (but I know many of you dabble in Rails).

If you have a Rails application in the wild. You need to run gem update rails as soon as reasonably possible, and get yourself to 1.1.6, there is a security flaw that hasn’t been made public yet.

See this CNet article for more details.

Tim O

AddThis Social Bookmark Button

Port RJS to Java. Ugh. i dread this task. I really do. Recreating RJS templates in Java….Yuck. I dread this task because I made fun of the prospect of some Java programmer having to recreate RJS in Java a few weeks ago on this blog, but, I’ve created an application in Rails that must be ported to Java. Don’t ask why, just know that it must be ported to Java. This isn’t the first time, I’ve had to port something from Rails to Java.

So…..errr…..what does one do if your Rails “prototype” makes heavy use of some of the most advanced features of RJS templates and you have to migrate to Java? My first thought: ask the fine readership of this blog if they have found themselves in a similar situation, or, better yet, is anyone out there already doing this? C’mon, I can’t be the only one in this wide world who has been using RJS and wondered, “Why can’t I do this in my Java application?” ….The first step, Google “RJS in Java” - that search returned a few hits, but mostly links to Rails RJS pages and links to blogs bemoaning the fact that Java isn’t there yet.

The real lesson here is “Never prototype with a technology more capable than the target platform.” So, take this as a lesson, if you are using Rails as a prototyping language, don’t use RJS, you’ll end up wishing that your prototyping technology was your production technology. As I’ve said before, J2EE is a trusted, capable platform, and in some ways it is lightyears ahead of Ruby, but, as far as web applications go Rails does laps around Java. So, maybe porting RJS to Java might help level the playing field? Maybe? Who knows, all I know is that I’m not the only only who thinks that Java is not Web 2.0.

Read on for the options…

Dejan Bosanac

AddThis Social Bookmark Button

First of all, SOAP is not my web service protocol of choice since I think it is overkill for the most of applications. I prefer the simplest possible solution for the problem, but when the service that you need is only available through SOAP, you don’t have much choice.

The fact is that .NET developers like SOAP and use it as a de-facto the only way to expose their services. Simplicity to do so is certainly one of the most important factors in this decision. While there is nothing generally wrong with this, the simplicity hides some traps for those that don’t take care. One such trap is making methods return (or accept parameters) of general types such as ADO.NET DataSet (something like JDBC ResultSet in Java).

Dejan Bosanac

AddThis Social Bookmark Button

If you ever needed to parse form-based multipart data, you are probably aware of the Jakarta Commons FileUpload library. But while this library is primarily intended to parse data directly from HttpRequest objects and thus handle uploading of files in your web application, it could be used to parse an arbitrary InputStream and extract multiparts from it too.

As you can probably guess, the part of the library that is related to handling file uploads is well documented, but for the low-level API you can only find the broken example in the JavaDocs. I know that this funcionality is rarely needed, but still it deserves a working example, so here it is.

Robert Cooper

AddThis Social Bookmark Button

In the Bible of Software Development, a new book has just been written.

Steve Jones’ SOA Anti-patterns is one of the best things I have read in a while. I do have to say, however, that I must be missing something on one point here.

Description

Organisations start with a detailed Process map and then attempt to “fit” this into a Service Oriented Architecture; this refactoring leads to process becoming the dominant feature and leads to a Process Oriented Architecture (POA) rather than SOA.
Effect

An organisation’s “Services” come in two basic types, firstly end-to-end processes that co-ordinate lots of individual steps, and secondly a large set of fine grained services that represent individual steps. Any hierarchy or structure is solely from the basis of process. The fine grained services proliferate and become difficult to manage while the large business process elements become difficult or impossible to change. The systems slowly, or quickly, stagnate and lead to solutions being built on top of the existing solution and the general treating of the process oriented system as a legacy application.

I must be missing something here, but this seems to represent EXACTLY what I hate about BPEL orchestrations. Now, I tend to be a fan of having somewhat fine grained services for systems-type access, and larger “Service-Services” that call back into them. The problem here is, both the anti-pattern and the resolution are pretty murky:

The first resolution is to independently of the process map create your services architecture. This will provide the structure for breaking down the processes and creating a clear hierarchy of use. Next, this service architecture should be over-laid onto the process map to understand where the cuts should be made. The current solutions can then be refactored to create a more service oriented solution by attacking the major inflexibilities in the system and then looking towards incremental change of the current systems.

This isn’t even so much about a technique or a pattern. What he is really saying here is “Hey, it helps if you plan stuff out and put a little A in your SO.” That is a whole lot of words for a “well duh” kinda point.

I do have to say, however, that Point to Point Web Services, DIY Transport, UBER Service and Defensive SOA all represent things that I have been railing against for months now at my current employer.

AddThis Social Bookmark Button

Here’s the definitive guide to the open source lightweight JBoss Seam - Contextual Components: A Framework for Java EE 5, version 1.0.1.GA.

AddThis Social Bookmark Button

This is a recap of sessions attended at JBoss World 2006, held recently:

AddThis Social Bookmark Button

This is a conference report of JBoss World 2006, held in Las Vegas, NV. This one focuses on the news highlights from the show. More coverage next week.

AddThis Social Bookmark Button

Here is the definitive guide/reference documentation to the Spring Framework, version 2.0 M5 release.

Paul Browne

AddThis Social Bookmark Button

If you want the full detail , go to this article by Tom Bayerns of JBoss.  If you want the superficial , lightweight version , stick right here!

Look at this picture. Isn’t it pretty?

What workflow is:

  1. You draw the above workflow diagram using the JBoss IDE (it’s a bit like Visio or any other drawing tool)
  2. You get your developers to put small bits of Java code behind each block (not difficult)
  3. Your business process changes? You drag and drop the diagram et Voila! you have your new business system already implemented.

Ok, it’s a gross simplification. But in terms of ‘drag and drop’ programming , it’s the closest that I’ve seen so far.

More stuff that we’ve written about workflow. Some posts, including Windows Workflow and the difference between JBoss Workflow Engine and JBoss Rules Engine (Drools) even have some detail in them.

Tim O

AddThis Social Bookmark Button

Smallest Blog entry ever follows: If you are looking for a great visualization library, take a look at Prefuse. It’s a visualization library written in Java and licensed under a BSD-style license. It has a rich set of demonstrations, and a helpful Introduction.

Dejan Bosanac

AddThis Social Bookmark Button

Recently I needed to display some information on the web page
according to the value of a cookie. I think that this is one of the
common web application functionalities that have been around for a
decade.
If you have ever used Spring MVC you know that view resolvers could be
instructed to expose request and session attributes as view variables.
It is done through the

<property name="exposeSessionAttributes"><value>true</value></property>
<property name="exposeRequestAttributes"><value>true</value></property>

properties in the appropriate view resolver configuration.
I wonder why there is no similar functionality for cookies, such as:

<property name="exposeCookies"><value>true</value></property>

or something similar.

Currently you have two options to deal with this issue:

  • Find cookies of interest in the controller and add it to the model manually.
  • Deal with the cookies in the view by using JavaScript.

I know that both of these ways are perfectly valid and will do the
trick for you, but this is one of the fundamental web features (and so
easy to implement) that I wonder how no one asked for it before. I
googled for it and found nothing. Or am I just missing something?

Paul Browne

AddThis Social Bookmark Button

The 2nd most useful Java-Oracle Tool that I’ve used this year is schema spy.

How often have you taken over a project without any documenation? Even worse , there is a database involved, and everybody just ‘knows’ (or pretends to know) where things are. What if all the orginal developers are gone and nobody is left to explain things? I can find my way around most legacy Java code , but databases leave me cold.

Still not convinced - take a look on the Schema Spy website. The level of information that this tool gives you takes you from knowing nothing about the database to knowing almost everything.

Interested in trying it out? Follow these simple steps
- Download it from http://schemaspy.sourceforge.net/
- Change the configuration to point to your database
- Install the Graphviz component (available here)
- Run the tool and await your fully documented database.

Just to shame the commercial competition , as well as Oracle , Schema Spy supports DB2, hsqldb , Microsoft SQL Server, MySQL, PostgreSQL and Sybase. It’s written by John Currier and is well worth a donation.

In case you’re wondering, the most useful Java-Oracle tool for 2006 is Oracle’s project raptor. Schema spy runs it a very close second. Considering that it’s a Billion dollar company Vs one man , I’d chalk that up as a victory for the little guy!

More Technical Blogs in Technology in Plain English

Tim O

AddThis Social Bookmark Button

Jackrabbit is a content repository from the Apache Software Foundation. It only graduated from the Apache Incubator recently, and there is a 1.0 release available. I’m impressed with what I’ve seen so far, but one note of caution is that the documentation (Javadoc) on the site is for the trunk release not the 1.0 release. There are some things you’ll probably want to investigate, like setting up persitence managers that retrieve a DataSource from JNDI. If you download the 1.0 distribution and attempt to use something like JNDIDatabasePersistenceManager you are going to have problems.

To get around this, you can checkout the Jackrabbit source from Subversion and build it using Maven 1.0.2.
If you check out the source, you’ll also want to check out the code in a contrib subproject jcr-commands. If you are looking for good code documentation, you’ll find it in this commandline tool.

I’ve been taking a closer look at JSR-170 lately, mainly because Content Management Systems are probably the single most abused product category in enterprise computing. The industry hasn’t converged on a single definition of what a Content Management System does and does not do, and I see JSR-170 as an attempt to provide some clarity and concepts to what I perceive as the current “Wild West” approach to selecting a CMS. When organziations select a CMS, they are usually selecting the product with the prettiest looking interface, JSR-170 is an attempt to put some badly needed standards and stability behind those pretty content management toolls. From what I’ve seen in JSR-170, I’m interested to see what the next revision of JCR will bring. Work has already begun on JSR-283

Tim O

AddThis Social Bookmark Button

A Maven 2 JIRA issue that caught my attention today. Extending a Web application has always been something I’ve been interested in doing, and it looks like David Hawkins submitted this feature to the Maven 2.x WAR plugin back in November, and I’m just now noticing.

I haven’t used this feature yet, but it is definitely something to take note of. Let’s say you have 10-20 web applications all of which reuse the same set of tag files, the same set of CSS, same icons, etc. You might customize a few JSP pages and add some custom classes. It makes sense to consolidate common elements into a generic “default” web application and then work some logic into your build that allows you to selectively override these defaults. The interesting part is that this plugin allows you to “copy the contents of dependent wars into the war being built. It will never overwrite existing files and has configurable includes and excludes which are applied to the files being copied”. So, you could conceivably create a number of mixins that your web application could inherit.

It could get messy if misused, but this seems like another step toward making web applications a bit easier. Anyone out there successfully using this feature?

Dejan Bosanac

AddThis Social Bookmark Button

In the previous post I showed how you can make a Spring wrapper around the WebServer object and thus configure it easily in Spring-based applications. This solution is good for standalone applications that use Spring as a configuration mechanism.

But if you are using Spring MVC to develop web applications you probably don’t want to start another web server to handle XML-RPC calls. Instead, we have to find a way to configure XML-RPC to work with the web server that hosts our application and again to use our beans as XML-RPC handlers.

On the first look I thought that the easiest way to achieve this is to wrap the XmlRpcServlet (available from version 3.0 on) in the ServletWrappingController. But when I started looking at the code I found a solution that is much more simple and elegant.

Tim O

AddThis Social Bookmark Button

I’ve been continuing to make small changes here and there to the MVN Registry. I’ve built out the version pages, such that you can look at a specific version of Commons Codec, and see exactly what depends on it and what it depends upon. In addition, if a project has filled out the right fields, every project version should have a description, a list of contributors and developers, a link to the project page, and a link to mailing lists.

I’ve also added two Top 25 lists to show you the most depended upon projects. The current leaderboard is commons-logging with 1053 projects depending on it, junit with 1036 projects, and Log4J with 689. If anyone has any feature requests, feel free to leave a comment.

Bill Siggelkow

AddThis Social Bookmark Button

I was recently given the unenviable task of providing my manager with a spreadsheet listing all the code artificacts (.java files, xml files, JSPs, etc.) that my team was working on. The list should include, among other things, all the source files under my src directory, JSPs under the web directory, and XML configuration files under web/WEB-INF. But it should exclude things like generated source code, .class files, and jar files.

My desktop at the client site runs Windows, so I thought I would try out the dir command. That got me nowhere. Then I jumped into cygwin and tried ls -R. Of course, this listed everything under my project directory, including the CVS directories and their contents. Plus, the file listing didn’t specify the full path. If I was going to use this output to create my spreadsheet it would take quite a lot of cutting, pasting, and deleting to make it suitable for the spreadsheet — there had to be a better way.

Dejan Bosanac

AddThis Social Bookmark Button

I tend to use XML-RPC to implement simple requirements for connecting applications. The reason is that it is a simple, straighforward remote-procedure protocol that has good-enough performance for most of such applications. Also, it is very wide-spread so you can find a stable implementation for whatever platform you need it (for example you can use it to connect Java and PHP applications).

When it comes to Java, I use the Apache XML-RPC library (http://ws.apache.org/xmlrpc/). Reasons: it’s been long time in development, it’s stable and I never had any problems with it.

Now, most of the applications that I write lately are based on the Spring framework, so obviously I needed an adapter (bean factory) for the Apache XML-RPC server. Since I haven’t found one, I had to write it by myself.

Tim O

AddThis Social Bookmark Button

In the course of trying to make sense of the Maven repository, I threw together a quick application to search for Maven artifacts. It’s nothing special at the moment, but at least it is a start. MVN Registry currently allows you to search for artifacts. Type in “struts” or “weblogic”, and the search interface will retrieve every artifact that has a matching substring. The interface than links directly to the ibiblio.org m2 repository.

Enter at your own rish, http://www.mavenregistry.com is an alpha.

Dejan Bosanac

AddThis Social Bookmark Button

This is the issue that I keep running into on various projects, so even if it seems obvious I think it is worth spending a post on it.

Some OR mapping frameworks tend to use batch update operations when dealing with the database. The “problem” that this approach introduces is that if any problem occurs during the update, a java.sql.BatchUpdateException exception will be thrown instead of the regular java.sql.SQLException. If we don’t handle BatchUpdateException properly the message it will give us will not be very useful.

Tim O

AddThis Social Bookmark Button

Related link: http://ndpsoftware.com/JSPXMLCheatSheet.html

Andrew Peterson of NDP Software has created a simple cheatsheet for JSP 2.0, JSP EL, and JSTL. I’m constantly “flipping” through the JSP 2.0 specs PDF trying to figure out what implicit objects are available in a JSP page and what the syntax is for fmt:formatDate, and Andrew has captured almost everything I needed in a single HTML page. del.icio.us.

Click here for the cheat sheet

Tim O

AddThis Social Bookmark Button

Related link: http://osgroup.raindance.com

If you are curious about Apache Geronimo, there is a recorded presentation by Jeff Genender over at raindance.com. Jeff gives a good overview of Geronimo: why it was created? what differentiates it from other servers? the sign up is free, and the presentation is about 71 minutes long.

click here to go to raindance.com

Tim O

AddThis Social Bookmark Button

Related link: http://jakarta.apache.org/commons/scxml

Stumbled upon an interesting utility last month: Commons SCXML promises to be an interesting tool for anyone who has to work with state machines. This component is based on a W3C recommendation form the Voice Working Group, and much of the initiall work has been completed by Rahul Akolkar.

Tim O

AddThis Social Bookmark Button

Related link: http://saxonica.blogharbor.com/blog

Here’s an interesting resource. Michael Kay’s new Saxon Blog promises to be a good resource for anyone using Saxon XSLT.

Paul Browne

AddThis Social Bookmark Button

Related link: http://www.firstpartners.net/blog/category/business/workflow/

Workflow is core to most business as it describes the core of what they do. Workflow can be as simple as ‘Search for Flights, Select Flight, Pay, Recieve Email confirmation’, to something much more complex (e.g. a Mortgage application). Many systems already have workflow in them, only they don’t know it. The problem is then that the Business People (who understand the workflow) can’t see how it is implemented in (hidden behind code), while the technical people don’t understand the business process. Workflow (closely related to Rule Engines) aim to solve this problem.

I recently attended an Irish .Net Developers presentation by Aiden O’Connor (long story), about the new Windows Workflow, currently in Beta as part of Microsoft .Net. While workflow in Enterprise Java is nothing new (Serverside Article), the implementation of Workflow in Visual Studio will bring it’s ideas to a wider audience, and force the Java workflow people to ‘raise their game’.

So, why should you be interested in Windows Workflow?

  1. Visual Studio has always had ‘Drag and Drop’ building of Systems. Now it will also have ‘Drag and Drop’ flowcharts (it looks a bit like Visio or other drawing tools). When the process hits a stage an Event is triggered and appropriate code called (e.g. similar to a mouse click on a form).
  2. It is likely that Business Analysts will use a Visual design tool to draw up the workflow. Programmers will then handle events at each stage in the workflow - a much easier process as they just have to concentrate on a single step, and not worry (so much) about the bigger picture.
  3. Long lived workflows and processes can be handled easily. For example, if we have issued the ticket and are waiting for the customer to check in (weeks later), state will be persisted automatically.
  4. It brings the workflow ideas from a niche to a wider audience. Even the Java based frameworks will benefit from this.
  5. It is part of the .Net framework - the equivalent in the Java world of coming free with the JVM. It will run anywhere .Net does, and one workflow can span multiple machines (this was buggy in the demo, but it is still Beta software).

Workflow, if and when it goes mainstream, has the potential to change the way we program as radicially as Visual Tools and OOP did.

Is workflow going to change your programming style? Are you going to be using workflow in your next project?

Tim O

AddThis Social Bookmark Button

Related link: http://sourceforge.net/projects/collections

Commons Collections has a ubiquitous presence in Java programming, and I haven’t seen a single project in the last four years that hasn’t included this library. For those of you who are looking for a version of Commons Collections with support for Java 5 generics, take a look at Commons-Collections with Generics.

Advertisement