Thoughts about Builder Pattern

Recently i watched the recorded presentation "Effective Java Reloaded" from Joshua Bloch which he held at the JavaOne 2006. He stated that static factories and constructors share a problem when they have many optional parameters. For example if you want to construct an ID3Tag object where lets say title and artist are mandatory and album, albumTrack, comment, year, genre etc. are optional one solutions is to write following constructor:

JAVA:
  1. ID3Tag(String title, String artist, String album,
  2.   int albumTrack, String comment, String year,
  3.   and a lot more optional parameters).

(more...)

11 comments January 10th, 2007 Mario Hochreiter

Day 4

Day 4 started with a keynote held by Marc Fleury inventor of JBoss. This was the craziest presentation so far and more like an Eminem show than the normal “technical” style of presentation. Afterwards Erich Gamma spoke about the Process they are using developing Eclipse in a highly distributed environment. Our project could learn a lot from these techniques because we are facing very similar problems. He also showed IBM’s upcoming team development tool called “JAZZ”.

Next to the keynotes I attended the talk about Grail hold by the inventor of Grails Graeme Rocher. Once again it was very interesting to see a dynamic language environment in action. Grails can be seen as kind of a façade for frameworks like EJB, Hibernate, Spring … which is written in Groovy. The goal is to provide Java newbie’s an easy start into the complex world of Java where you do not have to touch one single XML file to build for example a web application.

After lunch I first attended the talk about JSR-277 Java-Module-System by Stanley M. Ho leader of JSR-277. The goal of this JSR is to eliminate the problems that come with the JAR deployment (e.g. CLASSPATH hell, JAR hell). There this JSR describes a new packaging format as well as a new language feature which is coped in JSR-294. Afterwards I attended the talk called “Dynamic Applications with Faces and Ajax” by Roger Kitain the lead architect of JSF at SUN. This talk was about the possibility to ajaxify the JSF components today and how to integrate this into the upcoming JSF 2.0 standard where this point will be a major one.

Neal Gafter's talk about Closures for Java was besides Brian Goetz's talks one of the most fascainating one. Those guys really know how to talk about a very complex  topic in a very clear way so that  almost everyone  can understand it.

I was closing the day with Ted Newards talk about Interoperability between Java and .NET. This was one of the funniest talk. Ted is a very funny guy but he also has a lot of very deep knowledge in the field of both frameworks. I think his day must have more than 24 hours.

Add comment December 15th, 2006 Mario Hochreiter

Day 3 – The conference opened

The keynote was hold by representatives of the sponsors of the JavaPolis 06. For Oracle presented their Application Service Suite and Sun of course was proud to officially announce the version 6 of Java as well as the movement from Java to open source.
(more...)

Add comment December 15th, 2006 Mario Hochreiter

JavaPolis Day Three

JavaPolis University has closed its doors, giving way to the main conference. The latter is more about breadth than depth, with many short (typically one-hour) sessions instead of a few extensive ones. Among the more interesting sessions today was Guy Nirpaz from GigaSpaces talking about SOA in a stateful low-latency environment. Before presenting their own space-based approach, he discussed other ways of building SOAs, using technologies such as JMS, Jini, ESBs, and of course Web Services.
Today's brilliancy price goes to Brian Goetz for his talks on "Java Concurrency" and "Java Performance Myths". I'd like to elaborate on the latter, because it very much complies with my own beliefs. Brian showed lots of nice examples demonstrating that in the presence of modern JVMs, low-level performance tricks that we are used to from C and often also employ in Java programs almost never pay off. Or to put it in Brian's words: "Don't try to outsmart the JVM, or you will lose!". Why? Because JVMs already go to incredibly great lengths to optimize your code, and your own efforts might interfer with theirs. So unless you know exactly what you do (which basically means you are on Sun's JVM team), leave the low-level stuff to them! Otherwise you might end up with worse rather than better performance, while at the same time complicating if not breaking your code (remember the double-checked locking idiom?). Instead, spend your time on practicing a clean and simple programming style, and pay attention to good high-level design. This will ultimately take you much further, even in terms of performance. Thanks for the pleasure, Brian!
In the evening, Mario and I attended the "Meet your Java Idol" event. While not many of them showed up, at least there was free beer for everyone.

Add comment December 14th, 2006 Peter

JavaPolis Day Zero - An Almost True Story

Sunday 10 a.m.: Operation Javapolis '06 has begun. Reckoning that proper style is very important these days, my buddy Mario and I prepare our MacBooks, ride the Plane Experience from Linz over Vienna to Miami Brussels, then travel on Rails to Antwerp. What a journey for a software developer!
A check-in and a beer later, in an attempt to outsmart the average Java geek, we decide to confirm our conference registration (and more importantly grab a Java Duke) right away. After all, who wants to end up in a long blocking queue on Monday morning? "No problem" says the friendly guy at the hotel reception, "take bus no. 31 or 77, both of which leave - uhm - somewhere near the hotel". Now he could have been a bit more specific, but this would have deprived us of getting to know the beautiful scenery, accompanied by the not-so-beautiful weather. In case you are into sceneries, the one around our hotel is best described as a good blend of funny smells and ample streets packed with heavy traffic.
Strolling around for about 30 minutes, we have finally found what appears to be our bus stop. To our delight, bus no. 31 shows up from a distance shortly thereafter, quickly approaching our position. "Oh boy" I say to myself, "Belgian bus drivers really push their hardware to its limits", but hey - the damn bus doesn't stop! Neglecting our wish to come aboard, it shoots by and continues its fast-paced journey as if our existence wouldn't matter.
After two more unsuccessful tries to get on the plain-old-city-bus, wondering which bus stops where and why, at the same time freezing and counting the raindrops falling on our heads, we return to the hotel. If the bus is not willing to take us to JavaPolis, why not simply call a taxi? "No problem" says the friendly guy at the reception, "your taxi will arrive shortly. Did I - uhm - forget to say that in order to get on the bus, you have to make eye contact with the driver and do the Duke dance?"
We are standing right in front of the hotel. Every once in a while a taxi appears but - you guessed it - doesn't stop nor even comes close to us. By now we know that it's our fault, but believe it or not, making eye contact in the darkness is challenging at least, and even Wikipedia doesn't teach the Duke dance. Anyway, tonight's Javapolis registration closes at 9:00 p.m., only a few minutes from now. Realizing that no transportation system could take us there on time, we transform our frustration into a beer from the friendly guy at the reception, whose relaxed smile tells he is perfectly fine with taxis that never show up. Hopefully, JavaPolis registration will cope with two more outsmarted average Java geeks on Monday morning...

Add comment December 13th, 2006 Peter

Day 2 – All about the Web and Performance

This day I decided to attend the Java Performance Tuning speech from Heinz Kabutz and Kirk Pepperdine. This was the first University lesson where it was essential to bring your own laptop. After a short theoretical introduction about what typical project manager want (they said it’s a large “Go Fast Button”) the practical session started with a real world web application. They showed a lot of tools which are very helpful to measure the application performance like Apache JMeter or to measure the JVM bottlenecks like HPJTune and JAMon. Also the Java garbage collecting mechanism was explained in detail to understand the possible bottlenecks that can occur during garbage collection. The conclusion for this speech where the well known phrases like “First make it right than do performance optimization” and “Measure don’t guess”.
(more...)

Add comment December 13th, 2006 Mario Hochreiter

JavaPolis 06 - Day 1 - Warmup

After managing the "management" staff and finding out how to get a bus in Belgium I enjoyed the first day at the Javapolis 06.
I decided to start with a "non technical" topic in the morning: Domain-Driven Design - Putting the Model to Work presented by Eric Evans. Although I already knew basics about DDD I never had the time to read the book from Eric Evans but I am going to read it now. The presentation by Eric Evans confirmed my personal attitude about how important a domain specific language for a project can be and how important it is to find the "right" language in which you can talk with the business guys and in which they understand the technical people and vice versa.

Directly after the DDD speech I decided to cancel my lunch and watch a so called quickie about Maven 2.
This was a bad decision as the very short presentation did not tell me anything new about Maven. Furthermore, my stomach was yelling for food. Unfortunately, there was no more food available when I arrived at the lunch area. Hungry for food and information I decided to watch the presentation about Dynamic Languages on the Java Platform in the afternoon. After a short introduction into JSR 223 and the general stuff about dynamic languages two of them where presented in more detail: JRuby and Groovy. As I already knew some basics about Ruby and Groovy I was very interested in the "battle". The JRuby part was held by Thomas E. Enebo and Charles Oliver Nutter.
After a short introduction about the features they showed a very impressive example of JRuby in conjunction with Rails. Although, not every detail of Ruby is yet implemented in JRuby it looked very interesting to me. I think it is a good possibility for me to learn Ruby in more detail by playing around with JRuby.
The Groovy part was held by Dierk König. The presentation was very similar to the JRuby one besides that the syntax was a little bit different ;-). It convinced me once more that we should use Groovy in our project for writing unit tests and maybe for more like configuring Spring Beans.

That's it for the first day. More to come soon. The day will be closed with two Leffes (that's a belgian beer brand) and a lot of very interesting discussions with my colleague Peter.

Add comment December 12th, 2006 Mario Hochreiter

Next Posts


Categories

Links

Feeds