Technical Archives

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