Dec 30

Joel on JavaSchools. Move on :)

Java, Tech 240 Comments »

Joel is at it again with The Perils of Java Schools.

It is great to think that you are high and mightly because you can pack() and unpack() your way out of a paper bag, or that you love crazy pointer arithmetic.

These days, I want to develop with developers who can deliver business applications to our users.

It drove me nuts that my CSci program taught me how to write my own database from scratch, but didn’t teach me how to use Oracle well. If you needed me to write an OS from scratch… I was your man!

I had to go to industry to get the skills that truly matter to me now.

This isn’t to say that you don’t need anything from these courses, but they are far from required. There are 3 or 4 developers who I truly think are geniuses (that I have worked with). You know these guys. They get done the work that 100 others could maybe do. 3 of the 4 didn’t have CSci degrees. The other seemed to focus on music, art, and biography of all things.

There is room for different programs at college, but lets not get on our high horse.

Isn’t Joel whipping out crappy VB programs anyway? Not exactly amazing algo’s using the power of LISP is it? Have you checked out FogBugz? ;)

Dec 16

Running PHP in your J2EE server?

Java, PHP, Tech 106 Comments »

Caucho has a cool feature in their new server. They have PHP integration via their Quercus, a PHP implementation in Java.

To use PHP you can just register a PHP servlet (com.caucho.quercus.servlet.QuercusServlet).

You can also tie in PHP code to call any Java code via:

package example;

import com.caucho.quercus.module.AbstractQuercusModule;

public class HelloModule extends AbstractQuercusModule {
public static String hello_test(String message)
{
return "Hello, " + message;
}
}

and then using it like:

<?php echo hello_test("World") ?>

Another example of using Java as the platform, and various dynamic languages on top. JRuby. come to papa. Ruby on Rails on JVM.

Dec 16

Twinkle: Swing/OpenGL Photo Viewer

Java, Tech 2 Comments »

Microsoft Max was shown off at PDC, letting us see the great effects via Avalon.

Romain Guy is doing killer work with Swing, and just showed off Twinkle, which is a Swing demo using JOGL and Java2D to create a great looking UI.

Check it out to see the seemless effects, and how it isn’t rocket science also. You can grab the source. Romain has acknowledged that we don’t have a nice tool to build these yet… but we will get there.

twinkle

Dec 14

Spring 2.x: Two pain points solved

Java, Lightweight Containers, Tech 23 Comments »

It has been great to hear about the new Spring 2.0 features. There are a few much needed ones, but I was particulay interested to see solutions to pain points that I currently have:

Scoping

I discussed cleaning up scoping with JSF and Spring. The ugliness of having a jsf:scope attribute added via schema, and generated files is no more.

Spring 2.0 supports richer scopes, including web based ones (http session, request, etc) ThreadLocal, webflow conversations, and others. Being able to set the scope to these high level abstractions is needed.

Injecting Domain Objects

I run into, and need to use custom code for this one all the time. I want to inject a lot of the objects that I work with. One of the issues is that you want Spring to be in charge of the objects that you with to inject.

A common area in which this isn’t the case is when you get objects from your persistence store (e.g. hibernate). Having to have routines takes these objects and inject them is a pain, as we want this code hidden.

This is where Spring 2.0 comes into play. It allows you, via AOP, to go into these domain objects and wire them up correctly.

Very, very, nice.

Dec 05

20.weeks.ago vs. java.util.Calendar

Java, Ruby, Tech 7 Comments »

After playing with a Rails project that needed to do a lot of date maniupulation, I was shown another of the many “small” differences that make you so glad you are in Ruby-land.

With Ruby, and the time extensions that Rails adds to the Ruby time module, you get to do things like:

20.minutes.ago
20.hours.from_now

now = Time.now
now.at_beginning_of_year
now.midnight
now.last_month
now.monday
now.next_year
now.tomorrow
now.yesterday
now.seconds_since_midnight

This is just a touch of what you can do.

The thought of doing a lot of this work in Java with the great java.util.Calendar and java.util.Date makes me cringe. I have a DateUtil that I use to do a lot of work, and there are other utils like JodaTime etc, but none compare in my opinion.

Nov 28

Java web frameworks ready themselves

Java, Tech, Web Frameworks 3 Comments »

The troops are showing signs of grouping together. Java has been under attack from other platforms. We have the ASP.NET side, and now the main source of discussion, the dynamic language side (principally Rails, but also Django/TurboGear/etc etc).

The Java side knows that in-fighting isn’t good anymore, so we are seeing more and more of the groups working together.

At first the troops gathered around the Java Web Alignment Group, a loose affiliation where nothing has really happened (it is very new).

I think it was a “we should work together!” cry, with no hard action items.

The Spring guys saw JBoss Seam, and talk of Clarity came together (along with other folks).

I certainly feel that there is room for common Java stacks, and Spring is a project that can pull this off.

Now, even more recently, a new force has entered the fray. It is the joining of WebWork and Struts. The WebWork guys have already been working with the Struts TI guys (using XWork), and I think it is a great fit.

Struts has the name. WebWork has the technology.

I can’t wait to see what comes out of the Struts Action Framework 2.0.

It is important times for Java frameworks, to see if they can compete with the simplicity and productivity of some of the other frameworks (including some of their own like RIFE).

Let the games begin.

Nov 09

Symlinks and directories, versus EAR files

Java, PHP, Ruby, Tech 4 Comments »

Another post in the realm of dynamic platforms, and this time my thoughts are on deployment.

I have been working on a large web application, that is now in production.

The project before this one was on a large stack (WebSphere) and the deployment was a nightmare.

In development we had simple war’s and developers were all setup with expanded versions so they weren’t wasting time ziping up changes for a simple text change :)

However, the deployment issues were another story. They needed to be ear’d and run through a million checks on this, that, and a bit of the other.

We had to have our build system scripted to handle this all, and there were constant problems.

From that, I am now on a system where there are no such beasts as EARs. You just have good ole files and directories that the server looks too. Development is pretty much the same as deployment (bar a few optimizations that are taken care of via environment).

To jump between releases we can easily change a symlink and we are moved. An issue? we can move right back. No need to deploy/redeploy/undeploy in containers.

Bah I hear you scoff. What about all of the tools for deployment! How mickey mouse is this file based crud!

We have nice scripting via tools like Switchtower, which handles deployment very nicely indeed, and is easy to extend to do you will.

Lighter, and yet simple. Switchtower is still new-ish, so it may not do everything that you need in your deployment world… but it is getting there.

Oct 11

Urban performance legends, revisited

Java, Tech 1 Comment »

Remember the hub-ub of “Java is slow” back in the 1.x days?

Remember the buzz when .NET had the stack vs. heap ’struct’ world?

Brian Goetz is here to discuss Urban performance legends, revisited.

Brian gets down and dirty, and will amaze you with quips like:

Pop quiz: Which language boasts faster raw allocation performance, the
Java language, or C/C++? The answer may surprise you — allocation in
modern JVMs is far faster than the best
performing malloc implementations. The common code path
for new Object() in HotSpot 1.4.2 and later is
approximately 10 machine instructions (data provided by Sun; see Resources), whereas the best performing
malloc implementations in C require on average between 60
and 100 instructions per call (Detlefs, et. al.; see Resources). And allocation performance is not a
trivial component of overall performance — benchmarks show that many
real-world C and C++ programs, such as Perl and Ghostscript, spend 20
to 30 percent of their total execution time in malloc and

free — far more than the allocation and garbage
collection overhead of a healthy Java application (Zorn; see
Resources).

Give it a read, and don’t say “Java is slow”. Well, what about embedded devices, can we still say that realtime java isn’t quite there?

Oct 04

Java Install: First NetBeans, now Google Toolbar?

Google, Java, Tech 1 Comment »

How many times have I mistakenly clicks on the “JVM with NetBeans” link when trying to get the latest JRE onto a machine? More than I would like.

Now, I will have to watch out for the “JVM with Google Toolbar” link too? Are you kidding me?

Next we will have a “JVM with a MacDonalds Coupon” :)

I think it is great that Google and Sun are working together and all, but I look forward to an announcement of a real project that they worked on. This felt like a marketing project :) Google Office works ;)

Oct 04

Splashing around quickly with Mustang

Java, Tech 1 Comment »

Out of the corner of my eye I saw New Splash-Screen Functionality in Mustang, and how you can get a splash image up even BEFORE the JVM is started.

You can set a splash filename via:

java -splash:filename.gif SplashTest

or set it up in a jar manifest:

Manifest-Version: 1.0
Main-Class: SplashTest
SplashScreen-Image: filename.gif

And, of course you will often want to do more than just show an image, you may want to overlay a progress bar:

SplashScreen splash = SplashScreen.getSplashScreen();
Graphics2D g = (Graphics2D)splash.getGraphics();
Dimension size = splash.getDimension();
g.setComposite(AlphaComposite.Clear);
g.fillRect(0, 0, size.width, size.height);
g.setPaintMode();

I can’t wait to see the new splash images show up in Mustang based Java apps of the future :)

Loading...