Monday Jun 21, 2010

Uber Conf 2010 - Day 4 Report - OSGi/Java EE in GlassFish and Getting Started with Clojure

Uber Conf Day 4 (Day 3, 2, and 1) started with yet another 10 miler with fellow attendees in 1 hr 18 mins and 7:49 pace. It was slightly slower than the day before - guess physical exhaustion was setting in ;-) Here are the mile splits:

Thanks to Andy for showing how to turn on the Auto-Lap feature in Garmin 305 ... really handy!

I gave a talk on how GlassFish provides a great execution environment for deploying OSGi, Java EE, and hybrid applications easily. The slides are given below:

The remainder of the day was spent in Clojure track by Stuart Halloway. Next are some basic notes for getting started with Clojure:

Why Clojure ?

  • Power (hosted on jvm)
  • Robustness (functional)
  • Concurrency (identity, state, time)
  • Abstraction (OO done right)
  • Focus (lisp)

Together, these features add up to simplicity. Simplicity means

  • absence of incidental complexity
  • sufficient to meet your design constraints

Simplicity does not mean

  • Familiarity has nothing to do with simplicity
  • its not superficial, goes to the bone (e.g. only simpler syntax is just a sugar wrapper, look for the supported idioms)
  • does not mean easy, its very hard to be simple

Lot of code in Clojure is not about "set" something, its about invoke a function on it.

How to get started ?

Download the latest stable release or cutting edge build. The Clojure REPL (Read-Evaluate-Print Loop) is the easiest way to run a Clojure program as shown below:

~/tools/clojure/clojure-1.1.0 >java -cp clojure.jar clojure.main
Clojure 1.1.0
user=> (print "Hello World")
Hello Worldnil
user=> \^D


~/tools/clojure/jun7 >java -cp clojure.jar clojure.main
Clojure 1.2.0-master-SNAPSHOT
user=> (print "Hello World")
Hello Worldnil
user=> \^D

Notice, the first fragment shows how to run REPL using the latest stable release and the second fragment shows the same using the cutting edge build. "Ctrl+D" exits the REPL shell. Stuart mentioned that the Clojure community stays on the cutting edge build most of the times.

Alternatively, you can also clone "labrepl" from "" which is an environment for exploring the Clojure language. It also provides complete instructions for getting started with NetBeans/Enclojure, Eclipse/Counterclockwise, Maven, Max/Linux command line, Windows command line, IDEA/La Clojure, and Emacs.

Configuring Clojure in NetBeans using the Enclojure plugin with NetBeans 6.9 gives the following error:

but works easily with NetBeans 6.8. The IDE seem to support REPL, Java/Clojure integration, syntax highlighting, brace/paren/bracket matching, code navigation, debugger and lots of interesting features.

Here is a typical REPL getting started session with NetBeans and Enclojure:

Here are some equivalent syntax with Java:

Semantic Java Clojure
new new Widget("foo") (Widget. "foo")
Access static members Math.PI Math/PI
Access instance members rnd.nextInt() (.nextInt rnd)
Chaining access person.getAddress().getZipCode() (.. person getAddress getZipCode)
  • "defn" is a symbol so no new syntax for adding a method.
  • \^ introduces metadata for the next symbol, "greet" in this case. You can put metadata anywhere.
  • "clojure.core" is the core of Clojure's implementation
  • "javadoc" knows the default JDK javadocs, can make a local copy and/or extend it
  • "show" is Java reflection
  • "dir", "show", "source" are promoted from community version to the bleeding edge build.
  • Source is not always exposed
  • [1 2 3] Call the function 1 with arguments 2 & 3.
  • '(1 2 3) don't evaluate it and print as is, just tick it.
  • Idiomatically Clojure requires less parentheses than Java
  • Every single function in Clojure is Runnable and Callable

  • Java interop is simple, wrapper-free (raw), performant, complete

Compojure is a small, open source Web framework for Clojure based upon Ring (similar to Python's WSGI and Ruby's Rack). Otherwise Clojure apps are deployed as a JAR file.

A subsequent blog will show how to deploy a simple Clojure JAR file and a simple web app using Compojure on GlassFish.

And finally, here are my top-10 reasons (in no particular order) that I'd like to attend UberConf next year:

  1. Long 90 minute sessions
  2. Lots of hands-on workshops
  3. Fun Run as part of the formal agenda
  4. Beautiful location (Westin Westminster) with lots of running trails
  5. Great food (breakfast + lunch + dinner)
  6. Small attendance so intimate discussions with speakers
  7. Great set of speakers
  8. Rarely see session hopping
  9. Pure technology, no product pitching
  10. Swags are nice - bracelet-style USB stick with all the presos, 2 different tee-shirts, fancy folder and some additional goodies for speakers

See ya next year, hopefully!

Check out the complete set of pictures at:

Technorati: conf uberconf denver clojure compojure glassfish netbeans javaee osgi

Wednesday Jun 16, 2010

Uber Conf 2010 - Day 3 Report

Day 3 of Uber Conf 2010 (Day 2 and 1), again, started with a great run with fellow attendees - 10 miles in 1:15:22 with an average pace of 7:28 minutes/mile. Here is the speed-vs-elevation chart:

And complete details about the run are available below:

After a mentally and physically exhausting day, lets see how many runners show up for the run tomorrow morning. I'll try to be outside the lobby by around 6:30 am-ish.

Attended a 3 hour Scala for Java Programmers Workshop by Venkat and extensive notes + code samples on that are available here.

The next interesting talk I attended was on Emergent Design by Neal Ford and here are the key points:

  • Emergent Design is about finding idiomatic patterns (technical and domain) in your code that already exists
  • Architecture is stuff that's hard to change later - e.g. Language, Web framework. You write code on top of that framework and is the Design element which can be easily changed.
  • What is software design ? More details on
  • There are known unknowns and there are unknown unknowns - just like software.
  • Things that obscure emergent design: nature of complexity (essential and accidental),technical debt,rampant genericness
  • Emergent design enablers - TDD, Refactoring to remove technical debt, harvesting/cultivating idiomatic patterns
  • Use testing as a design tool, design will emerge from tests, will have better abstractions and less complexity
  • Reduce your Technical Debt by writing simpler code

I attended part of the Hudson Workshop and caught some part of Pragmatic Architecture Workshop.

Ted mentioned in his talk about three categories of knowledge:

  1. Things you know
  2. Things you know you don't know
  3. Things you don't know what you don't know

The goal is to move maximum amount of things from Category #3 to #2 and then from #2 to #1.

Attended another talk on How to Approach Refactoring by Venkat and here are the key points captured:

  • "Refactoring: genuine desire to improve the quality of your code and design in it" and it keeps you agile
  • Write a little code, make it better, write a little code, make it better, ... - evolutionary or emergent design leading to agile
  • Hardest part in refactoring & unit testing: slow down and take small steps
  • Commenting the code during refactoring is like leaving a dead rat on the table, that's what SCM is for
  • We fear to fail, the more we fail in small steps the more we succeed in bigger steps - go refactor your code and make it agile
  • Simplicity, Clarity, Brevity, Humanity - best principles to design and refactor code
  • Integrate more often and its less time consuming; Integrate less often and its more time consuming
  • Principles
    • Check in before you start refactoring
    • Rely on automated tests
    • Reduce, not add, code when refactoring
    • Follow the KISS (Keep It Simple Stupid)
    • Keep it DRY
    • Make code self documented, let the test be the documentation
    • Write readable code
    • Check in frequently, take small steps
    • Keep code at one level of abstraction

The evening concluded with a nice party and a wonderful magic show by Michael Carducci. Enjoy a short video of Jay "trying" to perform a magic trick:

Here are some pictures captured from earlier today:

And then the evolving album:

Technorati: conf uberconf denver refactoring design software architecture

Tuesday Jun 15, 2010

Über Conf Day 2 Trip Report

Day 2 of Über Conf (Day 1) started with about 30 runners heading out for a fun run. Some of us went farther than that and certainly felt the impact of running additional distance in this "mile high city". Here is a picture of some runners:

Here are some more pictures from the run:

Complete details about the run are below:

Many thanks to Ben Ellingson for arranging this!

The runners are meeting again outside the lobby at 7am. And if you are interested in a 10K+ run then I'll see you in the lobby at 6am.

I gave a talk on Java EE 6 & GlassFish 3 and the slides are now available:

I attended a few sessions today and here are my notes from them.

  • Transforming to Groovy - Venkat demonstrated Groovy's agility by taking converting a Java code to Groovy and highlighting the idioms on the way. He explained multi methods, delegation, improved reuse using Closures, Execute Around method, simplified List management, conciseness, multi-line string, file read, working with XML and other similar features of the language.
  • The Art of (Java) Benchmarking - Cliff Click talked about several micro and macro benchmarks and classified them in BUSTED and PLAUSIBLE categories with appropriate reasoning. There were clear recommendations such as warmup loops, planning for variation in results, multiple runs and reporting average and standard deviation, and many others to make sure the generated results are valid.
  • Hadoop Workshop I - The workshop required to run a VMWare image so I could not perform any of the hands-on stuff. But Matthew MucCullough gave a very good explanation of MapReduce, Hadoop, and other internals.
  • Building RESTful ROA Architecture at Orbitz - Alex Antonov talked about how Orbitz evolved from a Jini/Java-based SOA to a ROA architecture. He listed the standard request methods (GET, PUT, POST, DELETE), standard response codes (200, 202, 404, ...), clear resource representation, and simplicity of HTTP on "Why REST". A significant part of the talk was about Protocol Buffers - a language/platform neutral and extensible mechanism for serializing structured data.

The post-dinner panel discussion with @paulk_asert, @pragkirk, @iansrobinson , @johannarothman, @benrady, and @stuarthalloway was interesting as well.

Here are some of the Q&A from the session:

Q: What language would you recommend for beginning computer science ?
Stuart: Scheme
Kirk: Text-based environment does not excite them, try visual environment.
Paul: Most of the languages can give as many good habits as bad habits so no specific answer.
Ian: No specific language - something main stream like Java and C# and then move around.
Johanna: May be Scheme
Ben: Pure science (Lisp, C) or software engineering (Java, C#)

Q: What is the key to building resilience ?
Johanna: Broaden the specialties, expand the horizon
Ben: People who solve problems, use architect/development/testing/etc skills to solve the problems
Kirk: Always look for something that moves you away from your comfort zone
Stuart: Learning little bit about functional programming, start learning and you'll be there

Q. What strategies do you guys use to stay current ?
Stuart: Gadgets, follow the ambience using holes in the day (dropping kids, traffic lights, etc). Thinking during running and mechanical typing afterwards.
Ian: Highlight keywords, thinking during morning/evenings
Paul: Networking, look for smart people within your organization
Kirk: May be chained to desk 4 hrs but work hours is 10 hrs because of different gadgets
Ben: Follow the people that you know, RSS reader
Johanna: Don't keep up, pick & choose

Q. On your best project, what was the ratio of star/steady guys ?
Ben: 10:1 in a startup, the company folded
Stuart: 2:0 or 3:0 for the dream team, 5 too big
Johanna: 85 development team - all star, respect for each other, contentious discussions.
Kirk: 75 developers, 7 individuals core group drove the project. Fundamental force that made them succeed was team cohesion (been together for 2 years)
Paul: Have people in the team who can work
Ian: Diverse teams are good

There was discussion around craftsmanship and apprenticeship. Stuart talked about how "craftsmen swap" in like-minded shops can help the growth. There was also discussion around Resume-Driven-Development (RDD). Kirk and others point was that resume basically gets you to the interview, you still need to know the skill to get the job.

And just for fun, here is the panoramic view from my hotel room this morning:

It was simply breathtaking!

And here is the evolving photo album:

Technorati: conf uberconf glassfish javaee6 denver

Monday Jun 14, 2010

Über Conf Day 1 Trip Report

Jay Zimmerman kick started the 200th No Fluff Just Stuff event and Day 1 of Über Conf earlier today. This event is focused on alpha-geeks, with more access to speakers, more hands-on workshops, longer hours, and attendees from 45 different states.

Cliff Click gave a great keynote talking about Challenges and Directions in Java Virtual Machines. Here are some key points from his talk:

  • Hardware, Operating Systems, and JVM are ready for concurrent processing; Tools, Languages, IDEs, etc are not.
  • Background compilation, Concurrent GC, Introspection and continuous profiling are some opportunities for multi-core (2-4) machines.
  • Application level parallelism - JDK libraries are really useful, thread pools, pipelines of pools. No support for self-tuning and auto-sizing pipeline of thread pools.
  • Data parallelism is recommended for 4-32 core CPUs - Big data, small code, small code with lots of repetition, realm of scientific computing (weather, simulation, nuclear reactor, etc)
  • For 64-100 chips - Clustering on a chip, multiple applications communicating via pipes, GC fixed mallocs, parallelism at all levels (queues, caches, DB access, processor, ...)
  • Java concurrency is not right most times because of the lack of knowledge, not because of language features
  • Software Transactional Memory (STM) is replace existing locak with transaction boundaries, Step towards declarative program #1 issue while debugging other concurrent programs - "they can't name the shared variable"
  • Other performance pitfalls - Debugging, performance, Performance Anomalies
  • Suggestions for concurrent programming - Scala, Clojure, X10, JVSTM + Data modeling

The conference started on a positive note on a personal self with complimentary upgrade to first class in the flight and yet another complimentary upgrade to high-floor room in the hotel. I forgot my Garmin 305 USB connector but found another runner who has it, so nice!

Tomorrow morning starts with a 5K run and then Java EE 6 / GlassFish 3 talk at 10:30am in Westminster 1. The interesting part is that this is the first conference, at least I'm aware of, with a 5K run as part of the formal agenda. The hotel certainly has a lots of running trails near by and I did a 4 miler in the mile-high city. Looking forward to longer distance running on Wednesday and Thursday. The piano and magician during the evening reception added a good fun to the entire mix.

Now get ready to be physically and mentally exhausted!

Here are some pictures captured from today:

And here is the evolving photo album so far:

Technorati: conf uberconf denver glassfish javaee

Wednesday Apr 07, 2010

Java EE 6, GlassFish, NetBeans, Eclipse, OSGi at Über Conf: Jun 14-17, Denver

Über Conf is a conference by No Fluff Just Stuff gang and plans to blow the minds of attendees with over 100 in-depth sessions (90 minutes each) from over 40 world class speakers on the Java platform and pragmatic Agile practices targeted at developers, architects, and technical managers.

Get your hands dirty and learn from the industry leaders in an intimate setting where the attendance is capped at 500 and in the beautiful city of Denver.

I'll be speaking on:

  • Java EE 6 & GlassFish v3: Paving the path for the future
  • Getting the best of both worlds: OSGi & Java together

The talks will start with an introduction of key concepts and then provide a detailed overview of the technology. The talks will be interspersed with multiple demos to leave you feel empowered. There will be NetBeans and Eclipse (hopefully IDEA too) showing the simplicity, ease-of-use, and increased productivity with Java EE 6. There will be multiple demos showing OSGi application development and how OSGi + Java EE leverage the best of both worlds.

Keeping with the spirit of "No Fluff Just Stuff", the material presented will be purely technical :-)

Hear Jay Zimmerman (Über Conf Director) talk about the event. My first engagement with NFJS was Rich Web Experience 2007 and that was a great experience, truly "rich". This is my first speaking engagement with NFJS and looking forward to a long term relationship :-)

On a personal front, I never ran in Denver so looking forward to some nice runs in the mile high city! Any recommendations ?

Technorati: conf nofluffjuststuff uberconf denver glassfish javaee netbeans eclipse intellij osgi


profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.

Java EE 7 Samples

Stay Connected


« July 2016