Java Spotlight 12

[intro music]
Roger Brinkley: Welcome to the 12th edition of the Java Spotlight podcast. I am Roger Brinkley.
Terrence Barr: And I am Terrence Barr.
Roger: And in this edition of the podcast, we'll do a feature interview with Adam Bien who is a Java Champion, consultant, lecturer, speaker, software architect, developer and author of several Java books. Let's turn our attention, then, to our first segment which is the news segment. Alexis, you guys here have just a tremendous amount of GlassFish webinar series that are coming up.
Alexis Moussine-Pouchkine: Yes. we have, actually, a series that we kicked off a couple of weeks back. We had some technical difficulties but I think now we are set to have those 12 to 14 webinars in the next few months. And that's almost one a week. Yeah, it's pretty exciting. There is a lot of Java EE six content as well as some GlassFish specific there. So the dates are almost final though some of them might change. But we have a good idea of what will be covered and when that would be covered in the link that we have in the show notes.
Roger: Well, it looks like a great series, so we are excited about that. Tell us about some of the other stuff that's going on. You got Roller five and GlassFish 3.1.
Alexis: We initially said something along the lines of, we'll ship by the end of 2010. And 2011 is upon us. And we haven't shipped GlassFish 3.1. So what's up with that? Well, we thought quality was more important. And to be honest, we had a good number of bugs we didn't feel we could ship with. So we are going to take a little bit more time and ship a version of GlassFish that has full clustering, centralized admin and a whole set of new features that I think people will find exciting sometime in the February. So there is an update on this posted on the Aquarium.
Roger: On the centralized admins, I know that some of the stuff goes into GlassFish. Some of it goes into the proprietary product. Has there been some movement between the two of those?
Alexis: Everything people know and like about GlassFish Version 2, which is how you deal with an entire domain... And you can administer an entire domain. That domain is potentially multiple clusters with multiple instances in each. You can manage all of that from a centralized location. As a matter of fact, even from a single config file. So all of that will be there and, thus, in the open source version. Now we'll have some add-ons that will help further people manage their production environment. OK, so Roller, for people that don't know is really Apache Roller. That's the blog engine that we use on blogs.sun.com, and is quite heavily used. That's written in Java, of course.

And Dave Johnson who is the creator of Roller who was once a Sun employee is about to push out of the community working on Roller to push out version five.

And one of the exercises they went through was to run Roller, a non-trivial server side application on multiple Java EE application servers. So Dave has a number of blog posts on how not so difficult actually it was to do that. Whether he was running Roller on GlassFish, on WebSphere, JBoss or even Tomcat. So he documents the few hurdles he had to go through.

Roger: All right. Lets turn, then, to our event section. So on January 20th your first of the Glassfish webinar series that we talked about, web application development with Java EE 6, GlassFish and Netbeans. And it is a free webinar. Go to the show notes to see where you need to register for that. Then, on January 20th to the 21st, Arun Gupta is going to be in Budapest, Hungary, doing Java EE six equals Less Code plus More Power. And then, the January 24th to 26th, the Oracle user group leader summit at Oracle headquarters in Redwood Shores.

And then, finally, we've got another webinar series on the 27th building a simple web application with Java EE webinar.

Roger: OK. So let's turn now to our feature interview section, which is with Adam Bien. We had a great opportunity when we were both in China to be able to interview him. I am here with Adam Bien, Java champion and a developer in Germany. Welcome to the show.
Adam Bien: Hello, Roger. Thank you for interviewing me.
Roger: Give us a little history and give us some of your personal history and then how you got into Java development.
Adam: So I started Java development was JDK 1.0, it was 1995 or 1996. And since the, I spent my whole career actually working on the server side with Java. So the first migration project was from JDK 1.0 to 1.1. And then stick with Java. And I am freelancer. I am working as a freelancer across Europe. I stared with AWT then Swing and of course then came server and servlets. So I did a first project in Europe I guess, with Java web server. It was the very early stages of Java EE, I would say in 1997.

I would say 80 percent of my time I spend on server. And then I do, also, some client work.

Roger: What type of client are you working with at this point in time? You are just working with the Swing client or have you started working with the FX client.
Adam: I have to admit, I like Swing. It is very powerful and you can build great architectures with Swing. In case you understood the model, you control that pattern or modify the present pattern. So you have to build your models and not try to work around Swing.
Roger: Yeah, when you talk about FX, have you looked at what seem a general story, with the FX script. Yes it is interesting but what we need is something like stewardship from a big company. I would like to wait until Java FX 2.0 with the java API. And then someone could provide through DSL or domain specific language which would use the Java FX 2.0 API.

And I think Scala and Groovy and JavaScript are supposed to work anyway. But something like Java FX script would be nice as well with no explicit binding, and so forth.

Roger: So are you taking kind of a wait and see approach with Java FX 2.0 or.
Adam: I am one of the partners. So I will get the preview in general or something like this. And then I will try to evaluate thinking about whether it is interesting for my clients or not. And then see what happens. What I saw so far it is very interesting. It is not as concise as Java FX script, because it is java. So you cannot just bind methods or closures to listeners for instance. But this looks still promising and very interesting.
Roger: You come form a very strong client background that was based in Swing. Is this a good move you think, moving away from the scripting development and going directly to the API's.
Adam: OK, without community, I would choose Java FX script because it was very concise, and you can get rid of lots of code. There was no boilerplate. It was just Java FX script. The problem was it was Java FX script invented by Sun or Oracle. So it has no community behind. With Java FX 2.0, with the Java API, it is a lot smarter to going this way because you can then work with Groovy, Scala and the four guys, JRuby. Then the community becomes larger, and in case Java FX 2.0 becomes successful, we can still build the DSL like Java FX script.
Roger: So tell me a little bit about what you're doing on the server side.
Adam: OK. First, if you are coming from a GUI background, you will laugh about Java EE 6. It's very easy. It needs five annotations, you are ready to go. So the beauty of Java EE six and then seven is it's very, very easy. And people have, still, the complex J2EE stuff in mind, but Java EE six is very lean and powerful. And why is that? Because, with Java EE 5, dependency injection with convention over configuration was introduced. And what it means, if you are working on the server side, you don't have to configure anything. Because the server assumes certain configurations, which is just reasonable, like transactions, for instance. Everything is transactional. You don't have to configure anything. It's just, the code is very lean and very fast to implement.
Roger: So you're kind of a renaissance man. You can do just about anything with Java, then.
Adam: Yeah. Java is everywhere. Probably, you should give me a tutorial in Java ME or something like this. [laughter]

Then it'll be a full stack. But right now it's from client to server, with our Java Cards. Also, I have, still, the Java Ring, and I hacked my heating control with Sun SPOTs.

[laughter]

Roger: So you do some ME stuff, then?
Adam: Yeah, but only in Malaysia. [laughter]

Not for commercial purposes, I mean, here. I concentrate on the server side, Java EE 6, and the client side. And in Malaysia, I do a lot of stuff. Sun SPOT's a great technology, and I hacked my heating control because it was not as efficient as I thought.

In my case, I have an external sensor, and there were minus degrees. And with minus degrees, there is two's complement, it's called. But there is a scheme in the hardware where bits are inverted, and Java displayed 65,000 degrees, and the heating went off in winter. And since then, I'm only allowed to develop the heating in summer.

[laughter]

Roger: All right. So tell me a little bit about some of the applications you've worked on.
Adam: This is hard because I have to sign NDA everywhere. But I build server-side stuff, I would say, with modern Ajax stuff. Comet means real-time web with Java EE 6, lots of REST stuff, so exposing Java EE six via HTTP for iPhones, iPads, and stuff like that. And it's just boring enterprise stuff as well. I mean, insurances, independent service providers, or whatever you find. And in most of my projects, I just try to fix the problems or help the clients, like task forces. Something doesn't work and I try to help. So this is 50 percent of my time. I only see problems and try to help my clients, something like this.
Roger: All right. So what's the hardest problem you have come up against in your, boy, 16 years, 17 years of Java programming?
Adam: The hardest problems, memory leaks and synchronization issues. And in one project, a customer tried to reinvent the whole infrastructure by himself. He thought Java EE is too heavyweight, and they got the idea to build everything in a lightweight fashion. And this was really hard, because they had lots of problems with threading, synchronization. And we had to rebuild everything from scratch in three months, under pressure. This was actually hard. And what we did, because there was no time, we reinvented 50 percent of Java Enterprise Edition. So this is a very common one that the customer thinks, if they reinvent the wheel, it will be easier to manage. And it is not true.
Roger: All right. Let's turn our attention just a little bit, and let's go to the Java Champions mailing list and some of the stuff that's going back there. Let's talk about the JSRs that were just approved. Is Java moving in the right direction under Oracle leadership?
Adam: I was a Sun fan-boy. I don't know why, but I really liked Sun. I had almost no business relation with Sun, but people suspected me, really, that I worked for Sun. It was not true, not in my whole career. And I just like Oracle. [laughter]

I'm not an Oracle fan-boy, but I think what Oracle does is, actually, for Java, so far, great, what I saw.

Let's talk about Mac OS X, for instance. What Apple donated to OpenJDK is a bold move. I didn't believe that. I thought, "OK, now it's over." I have a Mac, and I was already afraid that I would not have JDK 1.7. I have to go back to Vista or something like this, or Windows 7. But this is perfect. And now IBM is supporting OpenJDK, which is also very interesting.

And what Oracle does, I think they are talking less and doing more. This is just my perception. And what I enjoyed at Sun, it was more open, but it not always became true, the dreams. Like Java FX, there was a lot of talk, and we have to wait three years until something happens. And I think, in Oracle, it's the other way around. They are not discussing as much and talking too much, and just doing things.

And from the business perspective, I appreciate it more because I can more rely on things. From my Java fan-boy perspective, it is a bit more boring. I think the thrill is gone, something like this. And I think what Oracle should do is just find some personalities, like Scott McNealy, James Gosling, something like this, and just to make Java more exciting again, just from the excitement's perspective, not from the technical one.

And involve community a bit more. They are already involving, but just try to involve even more. The Java Champions, they are a bit sensible about that, and the NetBeans Dream Team, and all the other guys, and the whole community, just to involve them more. But I think Oracle is working on that. And if I meet Oracle people at JavaOne, they all tried to improve things. I never met someone who'd say, "OK, I'm not interested in community," or something like this. But Oracle's a huge company, and every huge company behaves like that, so it's just normal in my eyes.

Roger: OK. Adam, thank you for your time. I appreciate it, and look forward to seeing you again.
Adam: Thank you for the interview.
Terrence: Yeah, it's quite amazing. Adam has been around the block a couple of times. He's been involved with Java for a long time. He's done a number of different projects. I quite like the house-heating system with the Sun SPOTs and the two's complement bug that he stumbled over. That's quite funny. I remember myself, in the early days of my C programming, that two's complement was always an issue, and you never knew, on your particular machine type that you're compiling down to, what the exact word size was. And so that's a funny thing to stumble over.
Roger: I like the way that he's done just about everything. I thought it was interesting, Alexis, where he says, "Oh, hey, if you think Swing's hard, Java EE is really easy."
Alexis: Right. It is easy. And actually, he's been great, both doing his no-slide coding sessions and being a supporter of Java EE 6. And not just a supporter; he's actually part of a number of expert groups. I think he actually has more influence than we do in adopting the technology, because he's not paid by Sun or Oracle, and he just does see a lot of projects and work for a good number of customers. It's really battle-tested arguments that he has, maybe more than we do. I really enjoy working with him and how he helps us promote Java EE, which, yes, it is much simpler than it has ever been.

Oh, and Adam was saying that he started with very old versions of both J2EE and Sun's older application server, and it got just so much simpler with years and versions going by, that it's just a pleasure to develop Java EE six today. You can't always start from scratch, but when you can, that's a lot of enjoyable moments.

The other thing is that I did an interview with him on the GlassFish podcast a few months back, and he was commenting on how he also liked to just remove a whole lot of code from existing applications, because all of those layers that were best practices at some point and designed patterns and what have you have become just anti-patterns. And he spends a lot of time just removing a lot of abstraction layers that are just not needed with Java EE 6.

Roger: He has a great article in the Oracle magazine for this two months, or it comes out every two months, called "Simplicity by Design." We'll put that in the show notes so that you can take a look at that as well. Great piece to take a look at, and go from there. So let's turn to the next segment, which is the mail bag segment. And we got an interesting mail piece and I think we're going to have everybody in on this one. Dramil Dodeja, I hope I said that right, from Reading, Pennsylvania, wrote "'10 Things Java Should Steal from Ruby,' what do you think?"

Java has a lot of things from the Ruby Rails lang, in terms of simplicity. So for those people that don't know, the "10 Things That Java Should Steal from Ruby" was a session that was done by Bruce Tate in August of 2006. So it is four and a half years old. I think Bruce was coming largely from an enterprise infrastructure. Closures, they're important abstractions more than syntactic sugar for loops. I think most of this was handled in JDK8.

Alexis: Well, you can't really say it was handled, right?
Roger: No, will be handled in JDK8.
Alexis: It is called Project Lambda for a reason. It's not exactly closures as some people would like to see them implemented, but obviously we have the constraint of not breaking anything in the language. So eventually you will get there, and I think what people expect from closures, they will get most of the benefits when JDK8 ships late 2012.
Roger: Second item is continuations.
Terrence: I'm not totally familiar with the concept as it's implemented in Ruby, but the way I understand it is that continuations are basically syntactic method of implementing certain types of optimizations, like where you can jump into a code with a history and a state. And I think that might be useful for certain cases, but in general, I'm not sure that it necessarily has to be a part of a programming language like Java. But maybe we should talk some more about that in upcoming episodes.
Roger: So the third one is meta-programming. Alexis, we were talking about this earlier, that this is just really not available in the strong type languages by definition itself.
Alexis: At least that's my definition of it. But we were also talking with Terrence, which, on meta-programming in general, according to Wikipedia, has a broader definition. So it really depends on what you're looking at. I was coming from the side of if you can change a behavior at run time, if you have open classes, add method to classes, that's certainly something that's not available to Java. And it's not on the road map because of the very nature of how statically typed the language is.
Terrence: But I think there's a little bit more to it. And again, I'm not sure exactly which part of the Ruby implementation or the Ruby language we're talking about. But there are some aspects of meta-programming that are available in Java in one way or another. For example, with the Java Reflection API, obviously, you can adapt and change the behavior of your algorithm to some extent at run time by looking at classes and their definitions, and then calling certain methods that you wouldn't have been able to call at compile time due to some dynamic behavior.

The other thing is dynamic execution of string expressions. So if you have JSR223 scripting for the Java language, then, of course, you could build strings, for example, containing JavaScript on the fly and then execute those. So that's certainly also possible.

Roger: Number four, conventions over XML.
Alexis: I think that one has essentially to do with Ruby on Rails more than Ruby the language. And certainly, we borrowed a good number of ideas from Ruby on Rails when we started working on ease of development in Java EE 5, which had to do with convention of a configuration as well as annotations rather than XML if you wanted to change that default behavior. I think we've done our job here, and certainly with the Java AC level, things like multi-catch coming up in JDK7 and Automatic Resource Management is going to help a great deal, have code that's more terse.
Roger: Number five, true templating rather than JSP.
Alexis: Yeah, JSP is kind of an old technology by now. It hasn't evolved in Java EE 6. Some people are asking for it to be pruned in future versions. Yeah, I think there's room for improvement there. That might come in the form of some sort of MVC, Model-View-Controller support in JAX-RS 2.0, which itself would be in Java EE 7. So there are obviously well known templating languages and frameworks out there, but nothing in the platform, nothing in Java EE that probably is good enough for today's requirements.
Roger: Scripting languages, number six, with HTML instead of Java.
Alexis: This was written in 2006. So I think, since that, we've seen things like Grails, which takes a lot of ideas from Ruby on Rails, only implements this with Groovy as a language. I think that's probably what comes closer to what the person was asking here, things like Groovy server pages instead of JSPs. And the other thing coming from the other side is that, you can also write JSF controllers, and any JSF artifact for that matter, using Groovy today, using with JSF 2.0, and certainly with the reference implementation with the Mahara implementation. So coming from the two ways, I think we've closed the gap here pretty much.
Roger: And I think in the ME space, Terrence, we saw at JavaOne at least one session about some new work that's going on in Russia.
Terrence: So that's part of the Java ME plus web project that Oracle is working on, where there will be much tighter integration between the Java ME run-time web content and JavaScript. And you can access one from another, you can make calls from JavaScript into Java and vice versa, and you can manipulate the DOM tree, another state of the web application, directly from Java. So there's a lot of integration coming there as well.
Roger: Number seven, investment in wrapping frameworks. Hibernate is strong but so is ActiveRecord. Each has its place.
Alexis: Yeah, I'm not sure about comparing the two. They are both object relational mapping frameworks. But, from what I understand, a good number of people are looking at or using in production things such as gRuby on top of NAP server, such as GlassFish. These people are actually looking at using JPA as a standard API, maybe as Hibernate as the implementation or things like EclipseLink or TopLink, just because it has such a broader support for different database schemas, more database support in general, like databases running on mainframes and such. In my opinion, I think Hibernate and JPA, as a standard, still has a good number of features that Active Record does not have. So I'm not sure exactly what wrapping frameworks means here, but if we're just comparing Hibernate and JPA and Active Records, I think JPA still has the lead there.
Roger: Number eight, focus on simplicity. Java's abandoning its base to handle the most difficult problems at the expense of 80 percent of the Java developers who build simple applications. You know, when I look at this, I was kind of thinking this is one of the key tenants of Java. We looked at Mark Reinhold's presentation. He had the big piece in there about 1995. That was one of the big piece. Alexa, you say this is better in EE6 and Java EE7, but it looks like it still needs some improvements.
Alexis: We can always improve on simplicity. Java EE5 had three things. One was ease of development. Two was ease of development. Three was ease of development. So I think we radically simplified things. We've gone further in EE6, and there's still things to be done, and probably in EE7. But I think we've done the bulk of the work. At the JDK, the Java AC level, there are still things to do. I did mention Auto Resource Management, Multi Cache and some of the project coin features that will be in that may seem like smaller changes, but really, at the end of the day, I think will make for Java being simpler than it is today.

I think it all comes down to this talk that James Gosling gave at the very beginning of Java, which was called "The Feel for Java." And we'll probably, maybe, talk at some point about, not just Ruby, but things like Scala. Bill Venners had this presentation called, "The Feel for Scala." It's not about being simple. It's about striking a balance between the simplicity and the power that the language has to offer.

With things like Generics, yes, it might be true that implementing generified APIs was something only so many people could get their hands around, their heads around. But on the other side, I think Java has remained true to its simplicity goals and still being able to evolve the platform, whether it's the language or the APIs as we do today in fairly significant ways. There's still a great to see because it's still fairly simple, I think, and we're simplifying things and yet, we're not standing still. We're really, actually, innovating on top of it.

Roger: Number nine, more aggressive stewardship. Take out bad features, stretch to add the important ones, even at the risk of breaking backwards compatibility. I think the big thing here was the last word of backwards compatibility, and Sun, when they owned Java, it was very clear that backwards compatibility was very important. Oracle is exactly the same way. It's a different thing. We can deprecate some of the APIs, but removal is kind of unlikely. One thing I do like, though, is the experimental programs like we had with Swing Labs and to a smaller extent, Java FX, where we're doing those outside of the core Java development area. So we try to do it once, use it, change it, and then incorporate it into the core facilities at that particular point in time.

I think that's a model that works fairly well.

Terrence: Don't forget Open JDK is now really the main driving force behind the evolution of the Java platform, and people can come in and create prototypes of language features, of libraries, and so on. Some of these are being migrated into the official versions of Java, as we can see with JDK 7, JDK 8. So the community can get involved. I think that's been really positive, as well that we might not be able to take in all features into Java, and there will always be some debate about the give and take of a certain feature that might be appropriate for a particular group of users, but not for others, and that complicates the language and the platform. But I think, by and large, developing these features in Open JDK, in Open Force, and being able to debate and prototype them and test them, I think is a very good sort of even handed approach to this overall issue of language development.
Roger: Number 10, embrace beginners. Java is no longer approachable. One of the things I did here was I thought I'd go out and talk a variety of people that are working with beginners, and read the notes that we have in the show notes, their comments are there. The synopsis of that would be, basically, Java is not that difficult per se for beginners, it's knowing where to start and knowing what to do, where to get in, where to do stuff. There's a lot of areas within Java that you can do. It's not just one small area, and a lot of places where you can really put your expertise. The other part is, don't necessarily let somebody pigeonhole you into thinking, "Oh, you know Java. Well, then you must know about mobile and embedded or you must know about the EE side or the desktop side or Java FX," or something like that. Know what you know and go from there. If you want to expand, certainly get your knowledge and go from there.

Take a look at what Daniel, Bruno, and Yara and Ian have said, there. Java is very much approachable as a language, and certainly something that embraces beginners.

So those are the 10 items. We took a little more time in the Mailbag segment than we normally would, but Dramil, I hope that answered your question on these items. We look forward to more interesting mail that would come into us in this area.

So let's turn to our final segment, which is the What's Cool segment. So Alexis, what's cool?

Alexis: What's really cool is that the Mac OSX project has actually started under Open JDK. We knew this was coming, but it was just kicked off now. We have the URL in the show notes.
Roger: Sounds good. Terrence, what's cool?
Terrence: Simon Ridder is back at Oracle. You might know Simon from many, many events and presentations. Simon has been active on the Evangelist Team at Sun, at the time, for a long, long time. He decided to check out the world outside of Sun and Oracle for a while, but now, he's back. So welcome back, Simon. We're looking forward to seeing and hearing a lot of you. [musical interlude]
Alexis: Thanks for listening to the 12th edition of, The Java Spotlight podcast. I'm Roger Brinkley.
Terrence: And I'm Terrence Barr.
Roger: Send your feedback to feedback@javaspotlight.org.


Transcript by CastingWords