Jazoon 2011, Day 2 – How frameworks can kill your projects and patterns to prevent you from getting killed – Sander Hoogendoorn

26. June, 2011

How frameworks can kill your projects and patterns to prevent you from getting killed – Sander Hoogendoorn

Sander talked about frameworks and the usual problems with them:

  • How to choose the best framework from over 9’000?
  • Some frameworks integrate only specific things (like logging or building a UI), others include everything and the kitchen sink. Which is better?
  • How do you convince your management to buy a framework, train the developers, testers, support people for it?
  • How do you get the other developers to agree to your choice?

After selecting a framework, the trouble starts:

  • What do you do it an important feature is missing? Do you add it? How do you maintain it? Do you file a bug report? What if it’s being ignored?
  • Half along the project, you find a framework that is better suited.
  • How do you handle bugs in the framework?
  • When do you upgrade after a new version comes out? What if the new version has dramatic changes that break a lot of your code?
  • What if development of your favorite framework stops? Do you take over or walk away?
  • If one framework isn’t enough, you’ll find that dependencies tend to kill you because all the problems above multiply.
  • Sometimes, framework A has a hidden dependency on logging framework B but your company uses logging framework C.

The way to answer these questions:

  • Know your architecture. What do you need where?
  • Instead of using the framework directly, put in an abstraction layer that says what you want and does it using the features of the framework. If “something” happens, chances are you only have to change the abstraction layer.
  • Use dependency injection to clean up your code from unwanted dependencies.

Jazoon 2011, Day 2 – JavaFX 2.0 With Alternative Languages – Groovy, Clojure, Scala, Fantom, and Visage – Stephen Chin

26. June, 2011

JavaFX 2.0 With Alternative Languages – Groovy, Clojure, Scala, Fantom, and Visage – Stephen Chin

Stephen showed how to use JavaFX 2.0 with other programming languages like Groovy or Scala. This is possible because the next version of JavaFX has a pure Java API for everything.

It was nice to see how well Groovy and Scala fared versus JavaFX itself. Even a dedicated Xtext-based DSL might not yield much better results.

Links:


Jazoon 2011, Day 2 – Java Concurrent Animated – Victor Grazi

26. June, 2011

Java Concurrent Animated – Victor Grazi

One picture says more than a thousand words. Now imagine what an animation can say. Victor did several for us to better understand the classes in java.util.concurrent. You can find the software on sourceforge: javaconcurrenta

Here is an example:

Very nice. I know a lot about threads and concurrency (the Amiga had preemptive multitasking back in 1986) but even I was surprised by the ReentrantReadWriteLock example: If you have a writer waiting for the lock and another reader comes along, should it get the lock immediately or should it wait for the writer to complete?

My first instinct was to get all the (quick) readers out of the way but chances are that, when all readers have been processed, another one might have come along, effectively starving the writer.

Links:


Jazoon 2011, Day 2 – NoSQL – Schemaless Data-stores Not Only for the Cloud – Thomas Schank

26. June, 2011

NoSQL – Schemaless Data-stores Not Only for the Cloud – Thomas Schank

Thomas gave an overview of some NoSQL databases and the theoretical background of it.

The main points are: SQL databases get inefficient as the data grows and if you need to split the data between instances (how do you join tables between two DB servers? Even if you can, performance is going to suffer).

But there are new problems: Data can be inconsistent for a while (keyword: MVCC).

OTOH, these databases don’t need locks and, as Amazon demonstrated, any kind of lock will eventually become a bottleneck:

Each node in a system should be able to make decisions purely based on local state. If you need to do something under high load with failures occurring and you need to reach agreement, you’re lost. If you’re concerned about scalability, any algorithm that forces you to run agreement will eventually become your bottleneck. Take that as a given.

Werner Vogels, Amazon CTO and Vice President

And since the servers can heal inconsistencies, broken connections don’t mean the end of the world. The acronym of the hour is BASE: Basically Available, Soft-state, Eventually consistent.

Interesting stuff, especially since every company owns a super-computer today. My own team has one with 64 cores, 64GB of RAM and 16TB of disk space sitting in 8 boxes spread under the desks of the developers. Not much but it only costs $8 000. And if we need more, we can simply buy another node. Unfortunately, it’s hard to leverage this power. I’ll come back to that in a later post.

One thing to take with you: If you can’t stand JavaScript but you need to write it, have a look at CoffeeScript.

Links:


Jazoon 2011, Day 2 – Who do You Trust? Beware of Your Brain – Linda Rising

26. June, 2011

Who do You Trust? Beware of Your Brain – Linda Rising

Are you prejudiced? No? Do you believe that some programming languages are slower than others? How do you know? Did you measure it or is it a … gut feeling?

Let’s face it, we’re all prejudiced. It’s human nature because survival is more important than getting along.

The better question is: What influences this process? Solomon Asch did a couple of very interesting experiments on that. It seems that if a trusted peer group is wrong, we tend to tag along anyway. So if everyone in the team believes that Groovy is slow or .NET is bad, we just suck it up, even if we happen to know better. The interesting part is why we do it.

Of course, we want to believe that we consider all options, carefully evaluate the impact of confronting the group, things like that. Yeah, that does happen – if you have enough time. Under pressure, your brain will just twist your view of the world until it fits. This means MRI showed that test subjects of the Asch conformity experiments actually “saw” other line lengths than were actually on paper.

But there is good news, too: If one person objects, this illusion breaks. This explains how a group of experts can be utterly wrong about something. Since groups tend to think of anyone else as them, an outsider can’t sway their belief but an insider can. So next time your team is doing something obviously stupid, speak up!

The talk also included reasons for social loafing (why a team doesn’t get stronger if you add more than three persons). Or how it was possible that soldiers in the First World War made peace with the enemy while entrenched: They inadvertently formed a team with the ultimate goal of survival.

A very interesting and frightening aspect is that our view of others doesn’t influence us alone but it also influences the way other behave. Women get the same results in mathematical tests as men if they don’t have to tick a gender box on the test. If you think a team member is an asshole, he will be, even if he hates you. Subconsciously, you’ll send the necessary signals and he’ll comply to them. Conversely, if you know that, you can turn an asshole into a normal person just by treating them better.

Very good, important talk. If you have a chance to meet/see her, go for it.

Links:


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.”