December 2006 Archives

Chris Adamson

AddThis Social Bookmark Button

What does a modern Java media library needs to be? Part 2 of this series looks at the ideas and capabilities of the current crop, including Java Media Framework, QuickTime for Java, IBM’s MPEG-4 Toolkit, and more. Part 1 set up the premise that the read/write nature of Web 2.0 requires media libraries to offer creative capabilities and not just playback, and argued that Desktop Java needs to offer more ambitious functionality to avoid being rendered irrelevant by webapps, Ajax, and Flash. Part 3 will discuss designs for an ideal Java media library and try to figure out who’ll pay for it.

Chris Adamson

AddThis Social Bookmark Button

This series of blog entries makes an argument for a new emphasis on dynamic media as presenting a unique opportunity for client side Java, maybe one of its last best chances. Act II will consider current Java media offerings and the ideas behind them. Act III will take the best of these to advocate a new direction for Java media, and attempt to figure out who’ll pay for it.

AddThis Social Bookmark Button

WebLogic 10 will support Java EE 5 (although the tech preview does not), including support for the new EJB 3 / Java Persistence API (JPA) specification. I really think that Java EE 5 is going to bring EJB to the masses because, although EJB 2.1 and earlier had immense power, it was so complicated to use that many companies bypassed EJBs altogether. EJB 3 gives you this same power and is much easier to use. More details

Krishna Srinivasan
Struts Articles and Tutorials

AddThis Social Bookmark Button

JBoss Seam is a powerful new application framework for building next generation Web 2.0 applications by unifying and integrating technologies such as Asynchronous JavaScript and XML (AJAX), Java Server Faces (JSF), Enterprise Java Beans (EJB3), Java Portlets and Business Process Management (BPM).

JBoss Seam

Thanks,
Krishna Srinivasan
Struts Articles and Tutorials

Tim O

AddThis Social Bookmark Button

In response to Paul’s last post, “Struts is the new Mini”. Paul I can see where you are coming from, but choosing tomorrow’s winners from yesterday’s successes has never been a winning strategy in immature markets. Many organizations have already abandoned Struts 1.x. The only organizations left using Struts 1.x are the slower corporations, and when these organizations finally get around to moving to a newer framework they’ll have a variety of mature technologies to choose from (and a lingering sense that they probably don’t want to repeat the mistakes of Struts 1.x). The real question people using Struts 1.x are going to be asking themselves, is, “How did I get stuck with a framework that didn’t evolve?” We’re talking about software, and unlike my 1999 Camry LE, there’s no reason why software should be discarded after 160,000 miles.

Struts 2 and Brand Continuity

The Struts community took a revolutionary approach as opposed to an evolutionary approach - they didn’t try to launch series of incremental model redesigns in an attempt to create a seamless transition to the “Struts + WebWork (aka Struts 2)”. They’ve only recently realized this and they have some brand repair to do in the next few months. Shale was the real brand opportunity, and for at least a year or two, everyone was talking about “Shale is the new Struts, should we move to Shale?”. Shale didn’t gain developer support or customer traction, and, in the end, the customer demanded an evolutionary approach. In the world of brand marketing you don’t risk a successful brand by introducing too much change all at once. The Toyota Camry is a good example.

Toyota redesigned the brand incrementally (’92, ‘97, ‘02, ‘07) and made dramatic changes to the car without changing the basic interface, but because they took small steps, they’ve preserved the brand. As a consumer, you conceptualize the Toyota Camry as a single continuous product line, but at the technical level the differences between a 1999 Camry and a 2007 Camry Hybrid are dramatic. My 1999 Camry is (almost) a completely different model than a 2004 Camry, and an entirely different car from the 2007 Camry Hybrid. (And the styling differences between standard Camrys and the newer sporty Camrys imply a purposeful brand distinction) Even with these changes, if I’ve had a good experience with my 99 Camry, I’m more likely to just buy an ‘07 Hybrid. On the other hand, the differences between Struts 1.x and Struts 2 break brand continuity, and, even though Struts 2 is a quality contender, you should consider it a new entry on the market. Struts 2 and Struts 1 might both be considered family sedans, they both might have the same odometer and steering wheel, but it’s a different drive train and don’t just assume that you are going to take it into the same mechanic. Struts is the new Mini in 2004, and the analysts are withholding judgment until we get a sense of the resale value. And, admittedly, the interface for a car is much simpler than the interface to a web application framework (steering wheel, ignition, and gas pedal vs. web.xml, struts-config.xml, and JavaBeans), so the automotive analogy shouldn’t be carried too far. read on…

Steve Anglin

AddThis Social Bookmark Button

Here are my winners and, yes, even losers for the most and least innovative and/or impacting Java technologies in 2006…

Paul Browne

AddThis Social Bookmark Button

No matter what car you drive , the chances are it was influenced by the Mini. Introduced in the UK in the 1960’s a whole generation of families was crammed into a car that popularized the notion of front wheel drive. While small , it was practical and drove so well it even starred in films such as The Italian Job. Recently, a more modern version was released with none of the parts but all of the spirit of the Original.

We’ll come back to the Mini, but if you build websites using Java, then at some point you have used Struts. The original Struts is proof that a framework / project / product doesn’t have to be the best to be the most widely accepted. It just has to be in the right place at the right time, and ‘do what is says on the tin’ - in this case a fairly useful implementation of the ‘Model-View-Controller’ design pattern.

So what’s the link? Seeing the original Mini from the outside may bring a smile to your face, but on the inside it’s cramped and unfortable. You may have happy memories of websites you built using the original Struts, but lately your thoughts have been straying to more modern frameworks, perhaps with Ajax and integration with Spring built in.

This is where Struts 2 comes in. Like the Mini, it has (almost) none of the parts , but all of the Spirit of the original. It’s based on Webwork which sounds scary, but most Struts Drivers will be able to climb in , find the Struts.xml file and get the engine running within minutes. Struts 2 is easier to drive (JavaBeans instead of Action Forms), more powerful (it can use Ajax and JSF) and comes with more optional extras (e.g. it’s integration with other frameworks like Webwork and Spring).

Best of all the Struts team have a clear migration path between the old and new Struts. You can use both side by side in your garage application, and change over the parts piece by piece. Spare parts for the original Struts will still be available for quite some time, both from the original team and the large dealer developer network that has built up around the framework.

What do you think? When Are you going to give Struts 2 a try?

More in Technology in Plain English

AddThis Social Bookmark Button

I am just trying in google to know what is in next version of Java. So many blogs writing about the new feature closures in Java 7.0, a functional programming cocept.

An excerpt from sun blogs:

Modern programming languages provide a mixture of primitives for composing programs. C#, Javascript, Ruby, Scala, and Smalltalk (to name just a few) have direct language support for function types and inline function-valued expression, called closures. A proposal for closures is working its way through the C++ standards committees as well. Function types provide a natural way to express some kinds of abstraction that are currently quite awkward to express in Java. For programming in the small, closures allow one to abstract an algorithm over a piece of code; that is, they allow one to more easily extract the common parts of two almost-identical pieces of code. For programming in the large, closures support APIs that express an algorithm abstracted over some computational aspect of the algorithm. We propose to add function types and closures to Java. We anticipate that the additional expressiveness of the language will simplify the use of existing APIs and enable new kinds of APIs that are currently too awkward to express using the best current idiom: interfaces and anonymous classes.

Java 7.0 (Dolphin) Resources and New features (Closures)

AddThis Social Bookmark Button

I have written one small program on how to execute scripts in Java 6.0

Introduction

In this article i will write a small program using Scripting feature in Java 6.0, a new feature introduced in Java 6.0 mustang. This is cool and more useful when we are working with the scripting languages. I am not going to explain in depth, will explain with very small example. In my next article i will write about the advanced features in script programming in java. Follow the steps to run your first script program in Java 6.0 :

Java Scripting in Java 6.0 (Mustang) - Article
Spring Resources and Articles
Struts Tutorials and Articles

AddThis Social Bookmark Button

Spring Modules is a collection of tools, add-ons and modules to extend the Spring Framework. The core goal of Spring Modules is to facilitate integration between Spring and other projects without cluttering or expanding the Spring core.

The new version contains the following notable features:

* new Ant module - access Spring beans from Ant.
* jbpm module - fixed cleanup of static fields which allow reuse of JBPM configuration in the same classloader (such as with testing)
* XT module - new HTML component added along with some important fixes
* all the modules have upgraded their Spring dependency to 2.0.1

More Details in www.springframework.org

Krishna
Spring Resources and Articles
Struts Tutorials and Articles

AddThis Social Bookmark Button

Details about upcoming Java 6.0 a.k.a Mustang and even 7.0 Dolphin are slowly emerging. It seems that Sun has reacted to the demands of the open source community and it has changed the way how the future Java releases are going to be developed. Plus there are interesting things coming.
It seems that Mustang (6.0) will be feature release, and that Dolphin (7.0)
should be a step up release like the 5.0 was. More

Krishna Srinivasan
Java 6.0 Resources and Articles
My Blog

Norbert Ehreke

AddThis Social Bookmark Button

Modelling business processes often involves manipulation and visualization of directed graphs. In a recent project our Java client software needed such a visualization tool, yet we had no time delving deep into these topics. Plus, reinventing the wheel is never such a great idea. After some googling I came up with a tool called yEd.

Tim O

AddThis Social Bookmark Button

Google Web Toolkit (GWT) 1.3 is being release under Apache Software License 2.0 - (read more)

AddThis Social Bookmark Button

Ending months of speculation, Google has officially joinedGoogle Web Toolkit the Eclipse Foundation as an add-in provider, according to officials at both organizations. In an interview with ZDNet, Eclipse Director Mike Milinkovich said:We are, of course, thrilled that Google decided to join the Eclipse Foundation. It was a nice gesture of support for the Eclipse community and it is appreciated. But what I am really excited about is the way that Google is using Eclipse as the development tools platform for the Google Web Toolkit. It is yet another demonstration of how Eclipse can be used as the tools platform for so many different languages and environments.
Read Here

Krishna Srinivasan
Java Resources
Spring Resources and Articles
Struts Tutorials and Articles

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

AddThis Social Bookmark Button

Dear Java Community,

As you can see, we’re making progress with our plans to open source Sun’s implementations of the Java platform. I’m happy to see Java technology embarking on a new journey with this official open-source licensing announcement.

Java technology has been a cornerstone of software development for more than a decade now — the community is ready for the next chapter, and the timing is right. As we stated at the JavaOne conference last May, the most crucial part of this decision was that we realized developers want to preserve compatibility, interoperability, and reliability. We intend to take steps to help make sure Java technology remains compatible, interoperable, and reliable. And we know the Java community feels the same way.

We will continue to do an immense amount of testing with the Java platform. Everything we do will get checked, rechecked, and we will debug rigorously. We expect that people who care about reliability and compatibility with the Java specification will continue to use and enhance Java technology.

One reason Java technology remains so popular is that it’s remarkably successful at spanning a lot of different domains. You can write software for application servers, cell phones, scientific programming, desktop applications, games, embedded software — the list is endless. We’re intend to maintain the support of this broad span of domains.

Sun continues to embrace open source, and I invite you to join us. There are all kinds of contributions you can make. If there’s a bug that you really care about, you can go work out a fix. (That’s one area where developers have made tens of thousands of contributions over the years.) I also invite you to help us add new features. If there’s new functionality that you really want in Java technology, the process is there to help you to add that to the platform as well.

Sincerely,
James Gosling

Links:
Spring Resources and Articles
Struts Tutorials and Articles

Steve Anglin

AddThis Social Bookmark Button

The following is a press release from Sun on the final official release of Java SE 6:

Robert Cooper

AddThis Social Bookmark Button

I hope this is wrong. I have already stated my views on the XML-in-the-language, but I really would hate to see -> come to Java.

Robert Cooper

AddThis Social Bookmark Button

Here is something that made me want to slam someone’s head through a wall today.

If you have worked with Tomcat before, you are no doubt familiar with the context.xml file. This is where you configure container managed resources. It has one property on the <context> tag that we were using explicitly. This is from the Tomcat docs as they are today:

docBase

The Document Base (also known as the Context Root) directory for this web application, or the pathname to the web application archive file (if this web application is being executed directly from the WAR file). You may specify an absolute pathname for this directory or WAR file, or a pathname that is relative to the appBase directory of the owning Host.

The appBase is the default “webapps” folder.

Now, the ways we are using it are rather beside the point, there are a number of reasons you might want to deploy the same docBase multiple times: perhaps you want to run the same webapp with different database settings, or a different authentication system. However, there is something that is left out of here. declaring [docBase=”myApp”] for a context path of “app” will fail. Even worse, it fails with one of those stupid log messages:

WARNING: A docBase C:\apache-tomcat-5.5.20\webapps\myApp inside the host appBase has been specified, and will be ignored.

[Then it continues booting like this isn’t a big deal..]

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\apache-tomcat-5.5.20\webapps\app does not exist or
is not a readable directory

Yeah, because you aren’t doing what I explicitly told you to do. This is software 101 here people: if you have a configuration option, what I give you as the configuration should be what you bloody well use. If stuff goes wrong from that point on, it is my fault. Defaults save me from myself, but if I want to shoot myself in the foot, let me. Sometimes there might be an alien or something on that foot and it actually is good idea.

Honestly, I was baffled. Why would someone do this? Who in their right mind would take a user-supplied explicit configuration and clobber it irrecoverably with a default value? It took me a while to think through, but I finally understood the reasoning here: a completely lazy programmer.

Lets look at another snippet of the docs:

Deploying on a running Tomcat server

autoDeploy set to “true” and a running Tomcat allows for:

  • Deployment of .WAR files copied into the Host appBase.
  • Deployment of exploded web applications which are
    copied into the Host appBase.
  • Re-deployment of a web application which has already been deployed from
    a .WAR when the new .WAR is provided. In this case the exploded
    web application is removed, and the .WAR is expanded again.
    Note that the explosion will not occur if the Host is configured
    so that .WARs are not exploded with a unpackWARs
    attribute set to “false”, in which case the web application
    will be simply redeployed as a compressed archive.
  • Re-deployment of a web application if the /WEB-INF/web.xml file (or any
    other resource defined as a WatchedResource) is updated.
  • Re-deployment of a web application if the Context Descriptor file from which
    the web application has been deployed is updated.
  • Re-deployment of a web application if a Context Descriptor file (with a
    filename corresponding to the Context path of the previously deployed
    web application) is added to the
    $CATALINA_HOME/conf/[enginename]/[hostname]/
    directory.
  • Undeployment of a web application if its document base (docBase)
    is deleted.
    Note that on Windows, this assumes that anti-locking
    features (see Context configuration) are enabled, otherwise it is not
    possible to delete the resources of a running web application.

[ed: emphasis mine]

And:

Undeploy an Existing Application

WARNING - This command will delete any web application artifacts that exist within appBase directory (typically “webapps”) for this virtual host. This will delete the the application .WAR, if present, the application directory resulting either from a deploy in unpacked form or from .WAR expansion as well as the XML Context definition from $CATALINA_HOME/conf/[enginename]/[hostname]/ directory. If you simply want to take an application out of service, you should use the /stop command instead.

(Note, WARNING is red and bold here in the original)

You see, rather than confirm in the deployer that the docBase was not in use by another context before deletion, it simply short circuits this by taking away flexibility. Now, frankly, knowing the risks associated with this, I am perfectly happy to continue along setting my docBases to shared folders. However, I no longer even get the option.

There is an alien on my foot, and Tomcat is going to let it eat me.

Paul Browne

AddThis Social Bookmark Button

Dear Open Source Santa,

Now that you have Java in your open source toy bag, can I have Duck Typing please ? It shouldn’t be too hard to do, since the elves in Ruby-Wonder-Land have been making toys with Duck Typing for years. I’ve been a good boy all year and promise to play nicely with the .Net kids next door.

You don’t know what Duck Typing is? Sorry, I forgot that you’re more than 1000 years old. Little Jamie next door got Ruby last year and he says that ‘if it looks like a duck, and walks like a duck , then it is a duck’. He says making the computer do more work makes it a lot easier to write programs.

My Teacher says not to be greedy, and that you’re very busy making Toy Trains. She says just ask for getters and setters. You know, the boring code like ‘getSomeValue()’ and setSomeValue(). She says the Apache imps have been very good with Dynaforms but that writing a Java web application is still just too slow.

Rudolph will tell you that writing get(”someValue”) is about as cool as having a bright red nose. He would also want to put ’someValue’ in one place only (the web page). Having to write config files and javabeans feels too much like homework.

Santa, I know there are other children that need changes to the core Java code more than I do, so maybe you know of an open source project that already has this.

Paul , Technology in Plain English

P.S. :I still want to keep compile time type checking to make sure I don’t make any mistakes.

Robert Cooper

AddThis Social Bookmark Button

This is completely off topic, so if the powers that be want to take it down, I understand. I would like to point readers of this space to Child’s Play. This is an annual drive to buy game systems and games for children’s hospitals around the world, and a very worthy cause this time of year.

Donations are tax deductible (see the FAQ), and 100% of contributions go to the kids (no handling or processing or administrative costs are taken out of donations).

If you are like me, and grew up with old school gaming, you understand what a motivating force it can be to move you into a career in software, and for kids in the hospital whose parents are tapped, this can be a really great thing.

Dejan Bosanac

AddThis Social Bookmark Button

I have this project that started years ago and still uses old Apache 1.1 version of the XML-RPC library. A few days ago I needed to add an extra functionality to the services it exposes. The underlying API for the new service works a lot with array of objects which is not friendly with that version of XML-RPC library.
The thing is that up until version 3.x of Apache library, Vector and Hashtable were only Java classes that could be used for transferring collections (<array> and <struct> XML-RPC types respectively). So naturally, I thought this was an ideal opportunity to upgrade to 3.x version, which is much better in handling various Java constructs (Object[] among them) as XML-RPC types. This is where surprises started to pop up.