Mar 16

Coyote: Dynamic language support in NetBeans

Groovy, IDE, Java, Tech 1 Comment »

It was great to hear about Coyote:

The goal of this project is to develop a set of NetBeans modules to help developers write code in dynamic languages using the NetBeans IDE. Initially, we are targeting the the Groovy and Jython languages, but we anticipate a common framework allowing support for more languages.

The coyote is a quiet, efficient animal that thrives in urban and rural settings without any particular encouragement, and once established in an ecosystem, is virtually impossible to eradicate.

Getting completion and the like for Groovy is a god-send. This will have me installing NetBeans just for that development, although coyote doesn’t support 4.1 beta (which is actually VERY slick).

I wish this was in IDEA and Eclipse ;)

Mar 15

Java is boring

Groovy, Java, Ruby, Tech 24 Comments »

Tim Bray has taken a look back at his first year at Sun, and claims that Java is boring.

He isn’t trying to start a flame war.

Java isn’t boring for many people, and that is fine. It is also a good choice, as he claims, for many tasks.

However, I have to agree with him. PERSONALLY I find Java a little boring. Sorry. Coding in it is boring (I know, I know, if the problem is interesting then who cares about the environment? I do).

I can’t state how many guys who use Java for most of their day job say to me:

“Man, I wish I could get a paying job with Ruby”

These people are playing with Ruby in their spare time. Then they get to do a prototype in it, and then it spreads from there.

Although Java the LANGUAGE is boring, that doesn’t mean the platform is.

I hope that 2005 is the year of more expression in many languages on the JVM. Come on Sun, get in the game. Get more people hacking away on languages like Groovy to see where it takes us. Where is the Sun version of Comega?

Boring Isn

Mar 13

Pseudocode becomes real code

Java, Ruby, Tech 19 Comments »

Brian McCallister wrote an interesting post (as per) explaining web containers.

One interesting point, is that although the topic is aimed at the Java spectrum, Brian uses Ruby as pseudocode in his tale.

The mix of Ruby/YAML is pretty clear, and does the job at getting the message across. This is because of the conciseness of the language. There is no extra crud that you have to put in there (static types, verbose APIs, etc).

So, if we want to write pseudocode in “language X”, I think that says a lot. Don’t we want our pseudocode to be as close to the metal as possible? Wouldn’t it be nice to take that pseudocode and just RUN it? We can :)

_why wrote about this too in Ruby as Coderspeak

Mar 11

AspectWerkz 2.0 final, on the way to AspectJ 5

AOP, Java, Tech 328 Comments »

The AspectWerkz team has released AspectWerkz 2.0 final.

AspectWerkz 2.0 final comes with bug fixes.

  • option -keepjp renamed in -genjp (generate jit join points) (affects offline mode)
  • perJVM mixin deployment-model restablished
  • after returning advice was not handled properly in some cases
  • issue with around advice and set() pointcut could happen with long/double fields
  • issue with serialization and advised classes not implementing directly java.io.Serializable
  • issue could happen when using hot re-deployment of advised J2EE applications

Read more and download

What’s new in 2.0

Mar 10

@EventDrivenArchitecture

AOP, Java, Tech 7 Comments »

I was sitting in a session next to Adrian Colyer, and he showed me what he had literally just hacked up.

It is a nice proof of concept showing a DSL for event driven code.

It allows you to simply specify a publisher:

class Producer {
public Producer() {}

@RaisesEvent("price-update") private int price;

@RaisesEvent("calculation-complete")
public int calculate(int x, int y) {
return x*y;
}

public void setPrice(int price) {
this.price = price;
}
}

and a subscriber:

@EventSubscriber static class Recipient {

// exposed public fields for testing
public int calculationResult = 0;
public int price = 0;

@OnEvent("calculation-complete")
void onCalculationCompletion(MethodBasedEvent event) {
System.out.println("calculation-complete, result = "
+ event.getResult());
calculationResult = (Integer)event.getResult();
}

@OnEvent("price-update")
void onPriceUpdate(FieldBasedEvent event){
System.out.println("price-update, new price = "
+ event.getValue());
price = (Integer) event.getValue();
}
}

I hope that this could be firmed up, and maybe at some point make it into the ajlib project! :)

Mar 08

Are we mature enough for TheServerSide Symposium (.NET and Java)

Java, Microsoft, Tech 8 Comments »

The old chestnut of “Java vs. .NET” has reared its head again (e.g. Java vs. Microsoft .Net debate rages).

I actually wished that one of the instant audience polls would have been:

How would like like TheServerSide to include other technologies outside of Java?

  • Only Java Tech please! This is your niche! Have a TSS.NET conference for that stuff
  • Other fringe tech, but from the point of view of an enterprise Java guy
  • I have to work in a heterogenous environment, so would love a hard core .NET track. Besides. I don’t have to go :)

The reason I mention this, is that I think the community has chilled out from the days of “oh man, I hope .NET doesn’t take over!”.

Now, several years have passed, and J2EE is doing fine. .NET is doing fine too. We can live in harmony ;)

These days, a lot of developers work in the world of both Java and .NET. In fact, what does it even mean to be an “enterprise Java developer”.

Why, just today I wrote SQL, Java, JavaScript, ruby, Groovy, bash, and had to look at XML. Hardly Java only :)

Now the politics has died down, I think there is a lot to gain by having a conference where the camps mix. I enjoyed my time at MS Tech Ed last year, and learnt a few things.

Are we ready?

Mar 08

Better, Faster, Lighter Ruby

Java, Ruby, Web Frameworks 16 Comments »

Justin Gehtland, co-author of Better, Faster, Lighter Java, has blogged about his experience porting an application running on a Java stack (Java/Spring/Hibernate/JSTL stack), to Ruby on Rails.

On speed of development

First of all, I

Mar 08

Annotating language extensions

AOP, Java, Tech 3 Comments »

Ramnivas Laddad has got a two-part article series AOP and metadata: A perfect match, part of the AOP@Work series, in the queue.

He also talks about using annotations for compile-time, and strucural modifications to a program.

E.g., wouldn’t this be a nice way to simplify get/setters (a la Groovy):

public class Person {
@Property(ReadOnly) private long id;
@Property private String name;
}

It is going to be very interesting to see how these types of annotations get into the system. Will open source projects start building them? Will we wait for the JCP to standardize on them?

Adrian Colyer has taken Ramnivas’ idea and whipped it up using AOP (showing that you don’t need a custom APT (annotation processing tool)).

Mar 08

JCAPTCHA: Open Source Security Plugin

Java, Security, Tech 7 Comments »

Since installing mt-scode for MoveableType, I wondered if there was a Java framework that would easily allow you to add CAPTCHA style authentication to our apps.

There is an open source framework: JCAPTCHA.

There is an article on the framework Use a CAPTCHA-based authentication module for J2EE Web applications

Spam has become one of the biggest menaces on the Web. Many community-based applications force authentication only to distinguish a valid user from an automated spam-bot, which can be overkill in some cases. CAPTCHAs help in differentiating between real users and automated bots. In this article, Anand Raman uses CAPTCHAs as weak authentication mechanisms for J2EE Web applications. He begins with a quick introduction to both the J2EE Web application security model and CAPTCHAs. He then builds on these concepts to implement a JAAS (Java Authentication and Authorization Service) login module using CAPTCHAs and integrates it with an application server’s existing security infrastructure. The artifacts are based on standard J2EE security mechanisms. Hence, the module can be reused on any J2EE application or across different application servers with some minor modifications.

We have been using Acegi security recently, rather than CMS, and it would be nice to plug this in over there.

I often worry about the images. On one site I had to reload 3 times to get an image in which I could actually read!

Mar 07

GeronoSpring: Developers can use Spring and claim EJB 3

EJB, Java, Open Source, Tech 11 Comments »

One of the controversial points of EJB 3, is whether it should be backwards compatible. The programming model is so different, that it hardly seems right to force 2.1 compliance, but rather, make that an option.

In fact, one of the instant poll questions at TheServerSide Symposium backed this up:

How do you think the EJB 3 spec should handle backwards compatibility (e.g. to allow for a Spring compliant version)

1) Make EJB 2.1 support and below MANDATORY
2) Make EJB 2.1 support and below OPTIONAL (a check box for vendors to compete)

The results came back as ~80% of the crowd wanting this to be optional. Linda DeMichiel mentioned on the panel that she did hear the community here, although I do realise that she has other groups wanting other things. Kudos to her for being the spec lead ;)

Many people at the show laid their point down:

Tim Dawson: Vendors don’t care that the spec enforces backwards compatibility, they care about which server vendors do!

Hear, hear,

We also know that many dev groups need to be able to say “I am using EJB compliant software”. This is from vendors to ISVs to large IT organizations. It is a reality. And, although a couple of vendors told me at the show:

Spring can support the EJB 3 annotations, so they will be source-code compliant…

I think this is short sited. You can’t say “Oh, well we aren’t EJB 3 certified, but we do grok it. Promise”.

So, what if the EJB spec does continue to enforce EJB 2.1 compatibility?

I am not as worried about this anymore. Of course, I would love to see the likes of Spring able to support EJB 3, but there is a good solution if it isn’t the case. Geronimo/Spring integration.

What if Geronimo had first class integration with Spring? Spring Beans/modules could automatically be loaded up with no need for anything else. There are many, many ways in which the two could integrate, and I have heard of some very exciting possibilities from the teams.

What this does, is that it changes the game. We can get the best of all worlds.

If you work in a place that requires “application servers” and the like, you can just use Geronimo for that need… which will be a fully compliant EJB 3, J2EE 5, server.

So, I predict that:

Geronimo will become the server to run the Spring framework within.

Imagine it! EJB 3 view on your Spring modules! No need for Spring to have to implement the spec at all!