Jazoon 2011, Day 1 – Future Directions for Java SE and Java EE – Simon Ritter

26. June, 2011

Future Directions for Java SE and Java EE – Simon Ritter

Simon gave an insight on some of the problems which the Java Community Process JCP had before Oracle bought Sun and then, he showed the plans for the next two major Java SE and EE release. Java SE 7 is due Juli 28th, 2011 (if nothing bad happens), Java 8 should ship end of 2012.

There wasn’t anything really new except the nice way in which Simon presented things.

Of course, the presentation ended with the usual (at least for US companies) disclaimer that all this is subject to change at any time.

On one hand, I think it’s good that Oracle simply break ahead and let’s the past rest. The blunders with OpenOffice, Java Harmony and Hudson created a lot of bad blood with the community. Their best chance is probably to finally present something substantial instead of always only upsetting everyone with their decisions.

What I found odd is the priorities: First, they want to broaden the developer base. Java is #1 right now (or so they say). Hm. They want to increase adoption. And they want to make developers more productive. In that order.

If I was in charge there, I’d put “make developers more productive” top of the list and kill everything else. Why? If Java is more productive than anything else, that will automatically increase adoption.

Oracle’s priority lists reads more along the lines “we know we can’t make developers more productive, especially not after making everyone hate us, so we’ll just blind them with advertising.” One of the major problems with Java is that they can’t change the language. It’s not that they really can’t but it could possible break so much existing code or drive the complexity up one final, deadly notch, so really, they can’t.

Which means Java (the language) is a dead-end. But they can’t admit that, either, because everyone things Java == language. Wikipedia has a list of languages that the Java VM can run. Developers are more productive with many of them. Groovy usually needs 3-4 times less code to solve some problem than Java code and it get’s better with every release. The same is true for Scalaor Ruby.

So maybe Oracle is right: A lot of advertisement to drive people away from the Java language and into the open arms of the many new, much more productive languages is actually a better solution than breaking the Java language itself. Today, performance (or the irrational fear for performance problems) plus the “teach old dog new trick” problem prevent wider adoption. The former is being solved with Da Vinci (part of Java 7) so this leaves us just with the latter – which means advertising is the way to go.

Oh, and they will merge the best features of JRockit into HotSpot (the Sun VM).


Jazoon 2011, Day 1 – Cross-Platform Mobile Development with Eclipse – Heiko Behrens and Peter Friese

26. June, 2011

Cross-Platform Mobile Development with Eclipse – Heiko Behrens and Peter Friese

The duo showed a nice example how a DSL (created with Xtext, of course) can be used to generate code for an iPhone app, an Android app, a standard Java web app and an app for the Google App Engine from the same source.

The point here is not to emulate all features on each platform but to fall back to sensible replacements if a platform doesn’t support something.

It also showed the blazing speed of the new Xtext 2 code generator.

Links:


Jazoon 2011, Day 1 – Java Security Trends: How to Leverage Growing Security Trends in Building Trust into Your Java Applications – James Gould and Srikanth Veeramachaneni

26. June, 2011

Java Security Trends: How to Leverage Growing Security Trends in Building Trust into Your Java Applications – James Gould and Srikanth Veeramachaneni

Nothing spectacular here for me. There was a nice diagram of an SSL handshake, some tips to debug SSL problems, code how to create keystores with the Java tools and how to convert a PEM key into something that Java’s keytool can use.

After that James gave an overview of DNSSEC and how to use it from Java (including code examples).

What I liked about the code examples is that they covered more than the trivial cases. For example, it showed how to specify per-key passwords (in addition to the usual per-keystore password).


Jazoon 2011, Day 1 – Eclipse Mylyn: Redefining the “I” of the IDE – Benjamin Muskalla

26. June, 2011

Eclipse Mylyn: Redefining the “I” of the IDE – Benjamin Muskalla

Mylyn is one of those things that can change your world if you just give it a chance. The talk emphasized one of the major points: We write the code in an IDE (integrated, not intelligent), we track bugs in a bug tracker, we communicate with email, twitter and Facebook and we track progress on a piece of paper.

Being able to save the context (i.e. the classes and files involved) in a bug, so, say, a junior doesn’t have to wade through the whole source to even get started, is something that I’ve been missing several times already. If only I wasn’t such an old dog, already.

Links:


Jazoon 2011, Day 1 – Flexible software analysis with Moose – Tudor Girba

26. June, 2011

Flexible software analysis with Moose – Tudor Girba

Moose is one of those gems that are hidden in the huge pile of good open source software. It’s a software to extract data from some source (for example a Java project) and then display the results of queries ran on that data. Moreover, it allows to quickly build applications to wade through that data and display it, say, the complexity of the code.

Very interesting stuff. I guess I’ll have to learn Smalltalk.

I’ll also come back to this with my next installment of TNBT – The Next Best Thing.

Links:

  • Moose – data analysis software
  • Humane assessment – “a software engineering method that makes the activity of assessment explicit and manageable.”

Composite Oriented Programming With Qi4j

9. June, 2011

Qi4j LogoComposite oriented programming (COP) addresses one of the short comings of OO: That the meaning of an object depends on the context.

In most OO languages today, it’s hard to change the type of an object. Actually, Object Oriented Programming should be called Class Oriented Programming because the class (the type) is the core feature which we use to build application.

But in the real world, objects can have several types. This isn’t polymorphism. It means that COP allows you use the data in an instance within the context of several classes.

For example, in Java, we have two methods which should be context sensitive: toString() and equals(). When I call toString(), I want a certain conversion but that can change depending on in which context I call it. In a debugger, I might want all fields. In the debug log, I might just want the name. In the UI, I will want a nice, user-configurable conversion.

equals() is a similar beast. Different contexts need different equals() methods that work on the same instance. For example in Hibernate, equals() should use the business key. Which is stupid: As soon as a primary key is assigned to the instance, it would be much faster and precise to use that to check for equality. But if you write a tool to compare graphs, your needs will be vastly different.

DI and IoC tools try to fill the similar gaps: At a certain point in time, your code needs a service and you can’t know ahead of time which implementation will be executing the service. While that works somewhat, it’s just a workaround for a fundamental flaw in todays OO languages: Type rules, instances are part of the problem.

Qi4j tries to solve this fundamental problem. Instead of writing huge classes that do everything, the application is created from small building blocks.

The typical case is names. A lot of instances have a name. Instead of writing this code once and using it everywhere, 10 lines of code are copied into every class: The field definition, getter and setter. And maybe you want to set the name from the constructor, so you need 8 more lines (one default constructor and one with the name parameter).

In Qi4j, you define this once. After that, you just add “extends NamedObject” in all the places where you need it. Almost no duplication. Since NamedObject is just an interface, you can collect several of these building blocks in your entity.


Don’t Use Class.forName()

1. June, 2011

If you use Class.forName(), then you should read this: What You Should Know about Class Loaders


Spray Graphiti – Xtext for the Eyes

30. May, 2011

I’ve come to love Xtext. It’s powerful out of the box, simple enough to grasp and the rough edges cut you just once (i.e. after you put tape over them, the hurting stops).

But sometimes, a picture says more than a thousand words. Unfortunately, creating a graphical editor is still a daunting task. Which probably explains why most graphical editors aren’t worth the shadow the mouse pointer casts over them.

If we only had a compact language to define UI editors … but wait, we have. Or rather we could have with a bit of help with Xtext.

Welcome project Spray. Spray is a DSL to create Graphiti editors.


Running C Code in a Java VM

19. May, 2011

If you ever need to run C Code in a Java VM, have a look at NestedVM. It’s a MIPS CPU emulator. All you need is a GCC cross compiler, then you can compile your C sources to MIPS assembler code and execute it with NestedVM.


Embedded Java 1.4 Compiler

19. May, 2011

If you need a small, fast Java 1.4 compiler that you can embed in your application, try Janino.