Rich Web Experience

NFJS / Java World Podcast

Private Events

Blogs

View all Blogs >>
  • Nathaniel Schutta

    Author, speaker, software engineer focused on user interface design.

    Clearly I’ve kicked off a trend - one day, I post about pro cess, a more»

  • Richard Monson-Haefel

    VP of Developer Relations, Curl Inc.

    more»

  • Erik Doernenburg

    Principal Consultant @ Thoughtworks

    For a few releases the Apple development tools have included OCUnit and many developers have now started to write unit tests. There are lots... more»

  • Ryan Shriver

    Business and Technology Consulting

    more»

  • Ted Neward

    Enterprise, Virtual Machine and Language Wonk

    The Pragmatic Programmer says, "Learn a new language every year". This is great advice, not just because it puts new tools into your mental... more»

  • Andrew Glover

    Co-author of "Continuous Integration"

    Dan North, the veritable progenitor of behavior driven development (or BDD), more»

  • Brian Pontarelli

    Brian Pontarelli - founder of Inversoft

    Found a good shortcut for getting access to hidden folders in OS X file dialogs and the Finder. It requires some typing and it doesn’t... more»

  • Neal Ford

    Application Architect at ThoughtWorks, Inc.

    Last weekend, I spoke at the Ag ile Experience in Reston. It was a great con more»

  • Mike Levin

    Software Developer specializing in Web2.0 websites

    GMail complains that the 44 Kbps internet dial up connection I'm using may be too slow. It suggests that I switch to HTML view. I reload the... more»

  • Jason Rudolph

    Author of Getting Started with Grails

    Tests increasingly serve multiple roles in today’s projects. They help us design APIs through test-driven development. They provide... more»

  • Jared Richardson

    Agile coach and co-author of Ship It

    For those of you who are wondering if Ruby is enterprise worthy, then eRubyCon is for you. The speaker list is a "W more»

  • Vladimir Vivien

    Software Engineer / Consultant

    Judging from the list of features that will be included in NetBeans 6.5, more»

  • Alex Miller

    Sr. Engineer with Terracotta Inc.

    Looks like the JavaOne team now has most of the audio up from the JavaOne 2008 conferen more»

  • David Bock

    Principal Consultant, CodeSherpas Inc.

    I just spent this weekend speaking at the Ag ile IT Exchange conference i more»

  • Howard Lewis Ship

    Creator of Tapestry and HiveMind

    Just hit a NullPointerException in some code: public boolean isOwner() { return authManager.getUser().equals(blog.g etOwner( more»

  • Michael Nygard

    Agile technology leader and dynamicist

    A couple of years ago, the Minneapolis-St. Paul airport introduced self-pay parking gates. Scan a credit card on the way in and on the way... more»

  • Scott Leberknight

    Chief Architect at Near Infinity

    I ran into a situation the other day with Groovy that baffled me at first. Let's create a range from 0.0 to 10.0 and then use it to check if... more»

  • Matt Raible

    Creator of AppFuse and author of Spring Live

    From the Link edIn Engineering Blog: more»

  • Venkat Subramaniam

    Founder of Agile Developer, Inc.

    This morning I got an email "I thought you might get a kick to see that your (and Andy���s) book was named one of the Top 100 Software more»

  • Guillaume LaForge

    Groovy Spec Lead & Project Manager

    more»

  • Jeff Brown

    G2One Director Of North American Operations - Groovy and Grails Developer

    I am pleased to announce that we have worked up a Grails plugin for Hudson. more»

  • Kirk Knoernschild

    Software Developer & Mentor

    I’ve published a summary of the OSGi survey results on the APS blog more»

  • Stuart Halloway

    CEO of Relevance

    I was talking to Tim the other day about auditing Rails projects, a more»

  • Graeme Rocher

    Project Lead of the Grails Project & CTO of G2One

    Brian Guan, one of the pioneers of Grails use within Link edIn, has started a more»

  • Brian Goetz

    Author of Java Concurrency in Practice

    This surprised the heck out of me.�� We recently finished a new TV room down in the basement.�� We have a 50″ plasma TV, mounted on the... more»

  • Pramod Sadalage

    Co-author of "Refactoring Databases:Evolutionary Database Development"

    So we version control/source control everything on our project.. code/data/artifacts/diagrams etc. yesterday I said why not extend it to my... more»

  • Jason Harwig

    Software Engineer

    I was reading a blog entry at more»

  • Craig Walls

    Author of Spring in Action

    For quite some time I've been pondering OSGi and how it fits into enterprise Java. And that interest has been magnified over the past month... more»

  • Keith Donald

    Lead of Spring Web and Creator of Spring Web Flow

    Today I am delivering a presentation entitled more»

  • Pratik Patel

    Software Architect

    Shake off that St. Patrick's day hang-over by coming over to the AJUG meeting this Tuesday, March 1 more»

  • Pete Behrens

    Organizational Agility Coach

    Marti nig & Associates Methods & Tools group recentl more»

  • Joseph Nusairat

    Author of Beginning JBoss Seam & Co-Author of Beginning Groovy & Grails

    Today is the first day of JBoss World, I survived the first three presentations and waiting for the keynote to be  complete to d more»

  • John Heintz

    Principal Consultant with New Aspects of Software

    This post is to mostly keep track of the numerous blog threads going on about IDLs and schemas for REST. I find myself with more to say that... more»

  • Brian Sam-Bodden

    Java author, Ruby geek and Open Source Advocate

    In this installment we are going to build the Dashboard page of the Tempo application. T more»

  • Mark Fisher

    Spring Integration Lead

    In my recent post, I had mentio more»

  • Ron Bodkin

    Chief Software Architect, Quantcast

    I'm looking forward to speaking at The Rich Web Experience conference in San Jose next month. The event runs from September 7th through 9th.... more»

  • Mark Goodwin

    Web Application Security Specialist

    We've already looked at one of the two big problems posed by anti DNS pinning on Java applets; because there's rebinding on the applet and... more»

  • Scott Davis

    Author of "Groovy Recipes" & TDD Expert

    Every time I see a live show at the Denver Botanic more»

  • Romain Guy

    Java User Interface expert.

    more»

  • Ramnivas Laddad

    Author of AspectJ in Action, Principal at SpringSource

    InfoQ.com has published my AOP myths and realities talk recorded at a No Fluff Just Stuff conference. InfoQ.com founded by Floyd Marine more»

  • David Geary

    Author of Graphic Java and co-author of Core JSF

    The 2006 NFJS tour kicked off t more»

  • Jason Hunter

    Author of Java Servlet Programming

    I just posted the JDOM 1.1 release for download. This release includes about 20 improvements and bug fixes. more»

  • Kito Mann

    Editor-in-chief of JSF Central and the author of JSF in Action

    Java™Server Faces (JSF) technology, a server-side framework that offers a component-based approach to Web user-interface development,... more»


In the Spotlight - Brian Goetz

Author of Java Concurrency in Practice

Brian Goetz has been a professional software developer for 20 years. He is the author of over 75 articles on software development, and his book, Java Concurrency In Practice, was published in May 2006 by Addison-Wesley. He serves on the JCP Expert Groups for JSRs 166 (concurrency utilities), 107 (caching), and 305 (annotations for safety analysis). He is a frequent presenter at JavaOne, OOPSLA, JavaPolis, SDWest, and the No Fluff Just Stuff Software Symposium Tour. Brian is a Sr. Staff Engineer at Sun Microsystems.





















Presentations by Brian Goetz

Java Performance Myths

Performance myths about the Java platform abound, from the general "Java is slow", to the more specific "reflection is slow", "allocation is slow", "synchronization is slow", "garbage collection is slow", etc. Many of these myths have their root in fact (in JDK 1.0, everything was slow); today, not only are many of these statements not true, but Java performance has surpassed that of C in many areas, such as memory management.

Structuring concurrent applications in JDK 5.0

JDK 5.0 is a huge step forward in developing concurrent Java classes and applications, providing a rich set of high-level concurrency building blocks.

Effective Concurrent Java

The Java programming language has turned a generation of applications programmers into concurrent programmers through its direct support of multithreading. However, the Java concurrency primitives are just that: primitive. From them you can build many concurrency utilities, but doing so takes great care as concurrent programming poses many traps for the unwary.

Garbage Collection in the HotSpot JVM

Pop quiz: which is faster, Java or C++? If you are talking about allocation performance, the answer is Java, hands-down.

Squashing bugs with FindBugs

Does your program have bugs, despite unit tests, integration tests, and code reviews? You bet. Are you using static analysis as part of your QA process? If not, you're probably missing out on some bugs that can be caught before they bite your customers.

Beyond ACID: transactions management, in theory and practice

Transactions are the software building blocks of enterprise applications, but not all transactional systems are created equally. This talk covers the basics of what transactions are, why they are essential to building reliable enterprise software, the fundamental properties of transactions, and how transactions are supported and implemented in popular frameworks such as Java EE and Spring.

The Java Memory Model

What's the worst thing that can happen when you fail to synchronize in a concurrent Java program? Its probably worse than you think -- modern shared-memory processors can do some pretty weird things when left to their own devices.




Books by Brian Goetz

by Brian Goetz

  • JDK 5.0 is a huge step forward for the development of concurrent applications in Java.
    With improvements to the JVM to support high-performance, scalable concurrent classes,
    and a rich set of new concurrency building blocks, novices and experts alike will find that it is
    easier than ever to develop concurrent Java applications.

    This book offers something for everyone -- novices will learn about thread-safe,
    concurrent utility classes, such as collections and thread pools,
    which shield them from many of the complexities of synchronization and thread-safety.
    Experienced developers will learn about flexible concurrency building blocks which can
    be composed into larger concurrent applications, and how to customize them to
    provide enhanced reliability, manageability, and graceful degradation under load.
    Concurrency experts will learn about new low-level facilities for implementing
    high-performance, wait-free, lock-free concurrent algorithms in Java.
  • Available At: http://www.amazon.com/gp/product/0321349601?ie=UTF8&tag=none..




cat /dev/random
Random thoughts on software, technology, and life


Brian Goetz's complete blog can be found at: http://www.briangoetz.com/blog

Saturday, June 7, 2008

This surprised the heck out of me.�� We recently finished a new TV room down in the basement.�� We have a 50″ plasma TV, mounted on the wall with an Omnimount UCL mount (quite an impressive bit of engineering — not cheap, but highly recommended.)�� Since the mount weighs upwards of 40 pounds, and supports a TV that weights 100 pounds on a torque arm as long as 2ft, it needs to be anchored pretty solidly to the wall.�� It is held up with 6 4″ long, 3/8″ wide lag screws, that screw into two separate studs.�� It does its job well.

So, my dad and I went to remove it from the wall.�� I removed the six screws, and we prepared to catch the mount.�� It didn’t fall off the wall.�� We tugged on it, and it still didn’t come off the wall.�� Seemed stuck so tight we thought we’d missed a screw!�� But we convinced ourselves there were no more screws, and the two of us pulled hard, and eventually it came off the wall — taking some of the wallboard with it.�� Apparently the pressure of being screwed up against the wallboard (and maybe the heat from the TV too over a few years)��turned the painted surface into a glue not only strong enough to hold a 40lb mount to a vertical wall but resist being pulled off!��


Monday, June 2, 2008

At the “Writing the Next Great Java Book” BOF at JavaOne, there were unfortunately many more questions than we had time to answer.�� Fortunately, Greg Doench saved the questions (presciently, they were submitted on paper), so I’ll answer a few here.��

Q: About how much time did you put into your book (effort, not duration)?��
A: In my case, the answers for effort and duration are the same, as I had the luxury of writing the book mostly-full-time — I made the book my foreground activity, though I still did some consulting and training while I was working on it.�� I spent approximately 16 months on the book — longer than planned (but in hindsight is no surprise.)��

Q: Was the financial compensation worthwhile?
A: Unless your name is Stephen King or JK Rowling, writing books is not something you do for the financial compensation.�� This is more true for technical books, because (a) the audience for books like Java Concurrency in Practice is not quite as large as the audience for Harry Potter, and (b) if you have the skills to write a good technical book you probably have the skills to get a well-paying technical job.�� Without going into the details, I’ll say that the compensation is about what I expected — but I went into it with very realistic expectations.�� The compensation comes in other forms.��

Q: How much support and assistance was provided by the publisher?
A: I think this is a matter of how much support and assistance you ask of the publisher — and how much the publisher thinks you need.�� In our case, we did everything ourselves, including typesetting and managing the review, copy editing, and index creation.�� These are things the publisher often does for authors (and might even have preferred to do), but we chose to do it ourselves, and the publisher agreed.�� Of course, this was more work, but it was work we gladly did.�� The A-W team was always responsive when we did ask for things.�� So I think the answer is “as much as you appear to need.”

Q: How does the short half-life of technical topics affect the effort?
A: I deliberately chose a topic with a longer half-life.�� This gave me the latitude to let the book tell me when it was done, rather than the schedule.�� For material with a shorter shelf life, I might be inclined to choose a shorter format, so that the book is less out-of-date by the time it is published.��

Q: What would you say about books that authors release chapters to the public as they write?
A: I think this presupposes a style of writing where the author sits down and writes the book linearly.�� I am sure some authors do this, and some topics are more amenable to this approach than others.�� But one of the most important freedoms in writing is the freedom to refactor continuously; very often you don’t figure out the right way to present the material until you’ve presented it the wrong way (just as with code.)�� There’s nothing wrong with putting the work out there early — this is a great source of free review — but you have to be careful that doing so doesn’t cause you to settle into the belief that the structure of the book has been decided.�� (The same risk is true of trying to adhere to a schedule that assigns due dates to specific chapters.)��

Q: How do you avoid example source code exploding without using unrealistic examples?
A: This is really hard!�� But its really important.�� In JCiP, we set a rule for ourselves of “no code example more than��a page”, with the target of making most of them a half page or less.�� This is not easy, especially in Java! (There was only one we had to break into two separate one-page listings.)�� We wanted the examples to each illustrate a single point, so that the reader could look at the example and easily see what it was trying to show.�� There are some obvious tricks; eliminating boilerplate code like constructors, getters, and setters helps a little bit.�� What worked for us was to pick realistic examples that the audience would immediately understand the utility of (such as a file crawler), but abstract away the irrelevant concrete details by not showing the bodies of methods that are not needed to make the point that the example is supposed to illustrate.�� For example, we have a set of examples in Chapter 8 where we illustrate searching for solutions to a class of puzzles such as the “sliding block puzzles.”�� But rather than focus on a specific puzzle — which would take lots of space and not offer all that much insight, we abstract the nature of the puzzle by defining an interface that specifies the initial position (in terms of an abstract Position class), valid moves (in terms of an abstract Move class), and the goal position.�� Then we can illustrates various search techniques in terms of the abstract puzzle without getting bogged down in the details.��

Q:��What would you say is the role of technical books in the age where the Internet is the fastest way to publish texts and technology changes so fast that one year after publishing texts become irrelevant?
A: Some technical books are simply a form of documentation; any book that has a version number in the title is likely to fall into this category.�� These books have a very short shelf life.�� Other books, those that tend to focus on concepts rather that specific technical details, tend to have a longer shelf life.���� In any case, the publishing industry needs to become more agile in its approach to managing the authoring and production process, and explore more seriously alternate publication vectors such as electronic publishing.��

More later.��


Saturday, May 31, 2008

At JavaOne this month, my publisher at Pearson, Greg Doench, hosted a panel/BOF entitled “Writing the Next Great Java Book.” Not surprisingly, when you get four authors in a room, you get seven opinions about what’s important in writing a book!

One thing that we (mostly Tim, actually) did for JCiP was set up an infrastructure for the book, similar to what you’d do for a software project. Version control, issue tracking, one-step build script, continuous build — all of these things offer the same benefits to book projects as they do for software.

One critical aspect of the build is the handling of program listings. It is incredibly tempting to cut and paste examples from the IDE into whatever source format you’re writing in (Word, Frame, LaTeX, DocBook), but this is a recipe for disaster — errors will invariably creep in as you try and make small tweaks (such as changing variable names) outside the IDE. And code examples with errors really undermine the reader’s confidence (or worse, they copy the incorrect example into their code.) So, we wanted to make sure that every code example compiled (and ideally, was tested.)

Our approach was to check the code into Subversion with the rest of the book artifacts, ensure that the build process compiled the code and ran the unit tests, and then automatically extract the examples from the code in a format into which they could be directly included by the build. Some systems (LaTeX, DocBook) make this sort of inclusion easier than others.

We marked the examples up with comments for formatting (bold, italic) and also with “snip here” comments that excluded the irrelevant portions of the code from the listings that actually went into the book. The attached perl script (phragmite.pl), written by Tim Peierls (based on an approach designed by Ken Arnold), takes as input a set of input files and produces a set of LaTeX files representing the extracted listings.

As an example, here is the Counter listing from Listing 4.1 of JCiP:

// !! Counter Simple thread-safe counter using the Java monitor pattern
// vv Counter
@ThreadSafe
public final class Counter {
  /*[*/@GuardedBy("this")/*]*/ private long value = 0;
  public /*[*/synchronized/*]*/ long getValue() {
    return value;
  }
  public /*[*/synchronized/*]*/ long increment() {
    if (value == Long.MAX_VALUE)
      throw new IllegalStateException(”counter overflow”);
    return ++value;
  }
}
// ^^ Counter

The first line identifies the type of the code fragment (!! for a “good example”, ?? for a “bad example” which would get decorated with a Mr. Yuk), the name of the fragment (Counter), and the listing caption. The lines with the ^^ and vv mean “snip from here to here”, and a listing can be made of multiple such fragments. The /*[*/ and /*]*/ comments mean “bold”. The following ANT target ran the script:

  <target name="listings">
    <exec dir="${bin.dir}" executable="perl">
      <arg value="${phragmite.pl}"/>
      <arg value="${listings.dir}"/>
      <arg value="${fragments.dir}/*.java"/>
      <arg value="${fragments.dir}/jcip/*.java"/>
    </exec>
  </target>

In the book’s LaTeX source, we use the following LaTeX macro to pull the listing in:

\newcommand{\JavaListing}[1]{\input{listings/#1}%


Saturday, May 17, 2008

Apparently, WordPress is vulnerable to some script injection bugs, and this site was hit by them.�� And Google tagged the site as “spreading malware”, so the site shows up with a warning in Google search results and FF3 users can’t get to it at all.�� I’ve upgraded Wordpress, scoured the DB for injected scripts, and am in the process of begging google to let me off the blacklist.

What a pain in the butt.�� People suck.��


Wednesday, April 30, 2008

I noticed this amusing typo at the trade show floor at SDWest this year.�� My first thought: wow, they really are tailored!

��tailored_indeed.jpg