Thứ Hai, 1 tháng 10, 2012

JavaOne 2012: Looking into the JVM Crystal Ball

I returned to Plaza A/B in the Hilton to attend the fourth session on Monday, but first went up to the top floor of the Hilton to pick up lunch. I'm reminded every year on the first day of JavaOne how surprisingly frustrating the first day's lunch acquiring process is for everyone involved. I know I found the experience a little confusing my first year at JavaOne as I wasn't sure where the lunches were available and I wasn't aware of the ticket for lunch included with my badge (that's what I get for my not reading the instructions first mentality). There was obvious confusion today as I heard people asking, "What ticket?" when asked to produce their lunch tickets. It didn't help that those trying to organize the hungry horde advised us to stay away from the top of the escalator, but didn't know exactly where we should go instead.

Mikael Vidstedt and Staffan Friberg presented "Looking into the JVM Crystal Ball." They stated that the two primary areas of coverage for this presentation are technical VM details and the VM roadmap. An early slide, "VM Convergence," talked about the convergence of JRockit and HotSpot as well as the CDC (Jave ME) and HotSpot Embedded convergence.

A slide on "Serviceability: Introspection and Analysis" talked about desire for "unified logging" (JEP 158) and "native memory tracking." Another slide with the same title talked about "Java Flight Recorder and Java Mission Control" that is a licensed feature in JRockit that will be available in HotSpot (still as a licensed feature).

A "Just Say Java" bullet refers to intent to "remove artificial memory limits and required tuning" and to "reduce the complexity of tuning the garbage collector." The end goal is a "single scalable VM for both client and server" using a "multi-tiered optimizing compiler." Another slide with the same "Enterprise: Server Java" title talked about "instant performance," "low latency garbage collector," and big data (requiring big heaps).

"Cloud and Virtualization: Multi Tenancy" was the title of a slide talking about "dynamic scaling and on-demand availability," maintaining "full isolation" and maximizing "resource utilization."

The "Developer Experience: Continued Improvement" slide referenced the value of multiple languages supported on the virtual machine. The slide and speaker also referenced improving the development experience with "dynamic development and debugging" through "close cooperation with IDE developers."

A JEP is a Java Enhancement Proposal and JEPs document via community process what is to be added to the virtual machine. It was stated in this session that the JVM can now be scaled from the small Raspberry Pi to the huge Exalogic T3-1B. The point was made that many of the things that benefit one of these extremes also benefit the opposite extreme and everything in between.

The "Footprint: Every byte counts!" slide covered some examples of features of the embedded JVM that the HotSpot VM developers are working to add to the HotSpot VM. These include "compact JVM internal structures" (JEP 147) and "dynamic sizing" of "interned string table," "system dictionary," and "caches." Both enterprise and embedded extremes benefit from these changes.

In conjunction with the bullet "Java Heap is 'Easy'," there was mention of HPROF and Java Mission Control. Native Memory Tracking is "really useful for hunting footprints in general."

JSR 292/JEP 160 (invokedynamic had some issues (NoClassDefFoundError) in its initial release, but they believe these issues have been addressed. As was stated in The Road to Lambda earlier today, Project Lambda is using invokedynamic. The point was made that this is evidence that invokedynamic is not just for "alternate JVM languages," but is useful for the Java language itself. Project Nashorn will also benefit from invokedynamic.

Three actions were outlined that optimize for multiple languages. These are "inlining" (all of which is done upfront today, but they'd like to enable compiler to incrementally inline), "escape analysis improvements" (analysis of ways to improve code), and "boxing elimination" (avoid extraneous object creation). JEP 165 deals with "fine-grained compiler control" and JEP 143 exists to improve lock contention.

There was discussion of the slide "G1 - Garbage First: The Future of Garbage Collection." It was explained that this changes the approach from "one ginormous Java heap" to heap treated as "many small parts." The -XX:+UseG1GC option was mentioned as a way to try out this new garbage collector as of JDK 7 Update 4. JEP 144 is designed to reduce garbage collection latency for large heaps.

"PermGen is no more!" is a bullet on the slide on the new JVM memory layout anjd is a result of JEP 122. This change is supposed to be "transparent to user," but they would like Java developers to try it out to make sure the change is truly invisible.

JEP 159 deals with "Enhanced Class Redefinition." They would like to relax today's "redefinition using java.lang.instrument, JVMTI, etc." to more than just redefining code body.

Another direction for the JVM developers is toward heterogeneous computing. "GPUs are very powerful and more available than in the past." Project Sumatra attempts to support GPUs and Arrays 2.0 concept.

The point was made that "the Cloud makes the deployment environment more fluid," but that "the JVM is in a unique position to help." Their goal is to ensure that the JVM can pick up cloud-related changes and maintain isolation.

It was pointed out that "a nice outcome of the removal of the Permanent Generation" is that "Class Data Sharing" now can work with all garbage collectors rather than working only with the serial collector. JEP 145 aims to reduce start-up time and to reduce warm-up time of a Java application.

It was emphasized several times in this presentation that developers can help test out and drive fixes and improvements by downloading the latest versions of the VM and language compiler, trying them out, and providing feedback. The JDK8 early access builds are available for download and the versions without permanent generation should be available soon.

JavaOne 2012: A Walk Through of Groovy's AST Transformations

I made the very short walk from Hilton Plaza A/B back to Hilton Golden Gate 3/4/5 to see the presentation "Walk through Groovy's AST Transformations." Groovy's AST Transformations are something I've dabbled with directly a few times, but have more often benefited from others' work with them. I had started reading the Packt Publishing book Groovy for Domain-Specific Languages, but wanted to attend this presentation to reinvigorate my interest and kick-start my increased use of this powerful tool.

Andres Almiray (Canoo) presented this presentation on Groovy AST Transformations. It did not surprise me that most of the audience had Groovy experience given that use of Groovy ASTs is likely more appealing to those with some familiarity with Groovy already.

Almiray defined AST Transformations as "essentially byte code generation" that "enables compile-time metaprogramming." He showed that Groovy has two types of AST Transformations: global and local. The focus of today's presentation is on global AST transformations.

The AST Transformations framework was added to Groovy years ago, but things were made much easier in Groovy 1.7. Almiray covered the Delegate Transformation (@Delegate annotation) in Groovy allows the compiled code to have all of the public methods of the field that was explicitly delegated to. Almiray explained that @Delegate works with interfaces as well as classes. Almiray also explained that any new method defined will take precedent over any delgate method of the same signature. Similarly, the first delegate encountered takes precedent over same method signature of other delegates.

Almiray then covered @Singleton and the Singleton Transformation. Almiray stated that the singleton implemented with this transformation meets the definition of a safe singleton described in Josh Bloch's Effective Java.

@Immutable (the Immutable Transformation) was covered next. Just as the @Singleton transformation automatically implemented all necessary rules for singletons, the @Immutable transformation implements the rules for immutable. Almiray noted that there are different exceptions for attempts to set a property on an immutable Groovy class via property set versus method set.

The next Groovy AST transformation to be covered was @Category (the Category Transformation). This was the first covered transformation that requires usage within Groovy code (not within Java code) to be fully used. The Mixin Transformation (@Mixin) was also covered.

Almiray moved onto coverage of @Grab (Grab Transformation), one which I have posted about before. @Grab is useful for downloading dependencies at runtime. I like it for the same reason that Almiray mentioned: "it's perfect for self-contained scripts."

Almiray introduced the @Synchronized (Synchronized Transformation) as a Groovier way to specify synchronized blocks. Almiray covered the @Lazy (Lazy Transformation), which is used to only initialize values when actually needed (when first used). Almiray pointed out Groovy's ability to access classes' private fields and cautioned that this should only be used for unit testing and only when absolutely necessary in production.

Almiray demonstrated use of @Newify (Newify Transformation) before showing a code sample using @Bindable (Bindable Transformation), which he stated was added to Groovy to make use of Swing easier. The transformation makes a class observable and removes the need to write all the code for explicitly doing this. The @Vetoable transformation similarly makes it easier to veto a property change.

As I described in my post Easy Groovy Logger Injection and Log Guarding, @Log (Log Transformation) can be very useful (as are @Commons, @Log4j, and @Slf4j).

Almiray covered some of my favorite and most often-used Groovy transformations: @ToString (see my post), @EqualsAndHashCode (see my post), @TupleConstructor (see my post), or the combination of them all (@Canonical - see my post).

Following coverage of @Canonical and its constituent transformations, Almiray moved onto covering @IndexedProperty (related post). He then listed several others without code samples: @AutoClone, @AutoExternalize, @ConditionalInterrupt, @TimedInterrupt, @ThreadInterrupt, @PackageScope ("gain back package-level access specificity in Groovy"), @WithReadLock, @WithWriteLock, and @Field ("mostly used inside scripts").

I was happy to see Almiray mention the addition of @TypeChecked to support "static Groovy!" He referenced a later presentation on new features of Groovy 2.0 to get more details.

Almiray mentioned new transformations specific to Grails (@Entity) and to Griffon (@EventPublisher, @PropertyListener, @Treading, and more). He referenced @Scalify and @Bytecode as well.

Although I was already familiar with a large percentage of the Groovy AST transformations covered in this presentation, it was still worthwhile to attend and learn of or be reminded of other useful transformations that are available.

JavaOne 2012: The Road to Lambda

One of the presentations I most eagerly anticipated for JavaOne 2012 was Brian Goetz's "The Road to Lambda." The taste of Lambda at last night's Technical Keynote only added to the anticipation. Held in the Hilton Plaza A/B, this was a short walk from the previous presentation that I attended in Golden Gate A/B/C. I had expected the relatively large Plaza A/B to be packed (standing-room only), but there were far more empty seats than I had expected.

Goetz started talking about Java 8 being "in the home stretch," but not yet released or ready for delivery. He said he expects Java 8 and Lambda to be available about this time next year. Goetz said that you "can write any program that's worth it to write using Java," but that Java 8 will make it much easier to do so. His slide "Modernizing Java" talked about Java SE 8 "modernizing the Java language" and "modernizing the Java libraries." His last bullet on the slide stated, "Together, perhaps the biggest upgrade ever to the Java programming model." This has been my feeling and that's part of why I was surprised this presentation was not better attended.

Goetz stated that a lambda expression is "an anonymous method." It has everything that a method has (argument list, return type, and body) except for the name. It allows you to "treat code as data." A method reference references an existing method. Goetz reiterated the huge fundamental shift to writing and using libraries that will result from addition of lambda expressions.

Goetz pointed out that most languages did not have closures when Java started in 1995, but that most languages other than Java do have closures today. He then summarized some of the history of closures in Java in the slide titled "Closures for Java - a long and winding road." He referenced Odersky's and Wadler's 1997 "Pizza" (1997), Java 1.1's inner classes (1997), and the 2006-2008 "vigorous community debate about closures" (including BGGA and CICE). Project Lambda was formed in December 2009 and associated JSR 335 was filed in November 2010. It is "fairly close to completion" today.

Goetz stated that the for loop is "over-specified for today's hardware" while describing the "accidental complexity" associated with use of "external iteration" that we frequently use today. I agreed with the point he made that the "foreach loop hides complex interaction between client and library."

The goal of lambda expressions allows the "how" to be moved from the client to the library. Goetz emphasized that this is more than a syntactic change because the library is in control with lambda expressions and it is an internal iteration. Goetz stated, "The client handles the 'what' and the library handles the 'how' and that is a good thing." He added that lambda expressions have a profound effect on how we code and especially on how we develop libraries.

Goetz discussed the new forEach(Block) method added to collections using the new default implementation mechanism for Java interfaces. Goetz differentiated that Java has always had multiple inheritance of types (can implement multiple interfaces), is now (Java 8) going to have multiple inheritance of behaviors (default method implementation available for interfaces), but still won't have multiple inheritance of state (the last of which he describes as the most dangerous). Goetz had a slide dedicated to explanation of why "diamonds are easy" when you take date (state) out of the multiple inheritance.

Goetz had a nice slide summarizing "Default Methods - Inheritance Rules." This slide featured three rules. He pointed out that "if default cannot be resolved via the rules, subclass must implement it." Goetz pointed out that an interface could provide a "weak" default implementation and subclasses can provide better implementations.

Another advantage of default methods on interfaces is that the default implementation can throw an exception (such as UnsupportedOperationException) for optional methods so that subclasses not implementing the optional behavior don't need to do anything else. Goetz also showed how lambda expressions enable the addition of reverse() and compose() methods to Comparator.

Goetz showed several examples of code that illustrated that lambda expressions allow for "cleaner" and "more natural" representations. In his words, "the code reads like the problem statement" thanks to the composability of the lambda expression-powered operations. There is also "no mutable state in the client."

One of Goetz's slides had a quote I plan to use in the future: "Laziness can be more efficient." The context of this is that laziness can be more efficient if you're not going to use all of the results because you can stop looking once a match is determined. Stream operations are either intermediate (lazy) or terminal (naturally eager).

The Stream is an abstraction introduced to allow for addition of bulk operations and "represents a stream of values." Goetz's bullet cautioned that a Stream is "not a data structure" and "doesn't store the values." The aim here was to avoid noise in setting things up and try to be more "fluent."

Goetz stated that "one of Java's friends has always been libraries." He talked about how lambda expressions enable greater parallelism in the Java libraries. Goetz stated that fork-join is powerful but not necessarily easy to use. Goetz emphasized that "Writing serial code is easy; writing parallel code is a pain in the ass." Lambda expressions will still require parallelism to be explicit, but should be unobtrusive with lambda expressions and their impact on the libraries.

To emphasize Project Lambda's effect on parallelism in the libraries, Goetz showed a painful slide with how parallel sum with collections would be done today with fork-join and then another slide showing the much simpler use of lambda expressions. The point was made: much less code with lambda expressions, making the business logic a much larger percentage of the overall code.

Goetz introduced Spliterator as the "parallel analogue of Iterator." The Spliterator's prescribed behaviors are available to any object that knows how to split itself (Spliterable).

The slide "Lambdas Enable Better APIs" drove home the powerful and welcome effect of lambda expressions on the standard Java APIs. He emphasized that the "key effect on APIs is more composability.

Goetz stated that we typically prefer evolving programming model via libraries than language syntax for numerous reasons such as less cost, less risk, etc. He summarized his presentation by stating that times have changed and it is no longer a radical idea for Java to support closures.

One of the attendees asked why lambda expression method support is on the collections rather than on iterators. Goetz said that although C# did approach it from the iterator approach, his team found it less confusing for developers to have the methods on the collections instead of on the iterators.

In response to another question, Goetz stated that reflection on lambda expressions is not yet available due to its complexity. In response to another question, Goetz stated that lambda expression support is built with invokedynamic and method handles. This is part of an effort to make lambda expressions "fun to program" and "fast."

Another question led to a really interesting response from Goetz in which Goetz explained that the availability of internal iteration within a collection itself means the iteration complexity will be encountered by far fewer people (library developers rather than end user developers). Goetz encouraged attendees to run Java 8 drops currently available to help determine if Lambda expressions are being handled correctly. Goetz remarked, "The most valuable contribution we get from the community are people who say, 'I tried it out and found this bug.'"

Goetz started this presentation by stating that this was one in a long line of presentations at previous JavaOne conferences and other conferences on the state of lambda. What was different about this one, however, is that Project Lambda is "almost there" and, with that in mind, it seems that the syntax and concepts are largely in place. This obvious solidification of the APIs and syntax is welcome and this presentation met my very high expectations for it.

JavaOne 2012: How Do Non-Blocking Data Structures Work?

I was a little surprised when I looked at my schedule for today and noted that all of the sessions I have currently planned to see today are in the Hilton. This became a little less surprising when I realized that about half of the JavaOne presentations are in the Hilton and that they seem to be roughly located by track.

Tobias Lindaaker's (Neo Technology) presentation "How Do Atomic Data Structures Work?" was held in the Hilton's Golden Gate 3/4/5 conference room area. Lindaaker changed his presentation's title since he originally submitted the abstract. The abstract's title (and that listed in the conference materials) was "How Do Atomic Data Structures Work?," but he has renamed it to "How Do Non-Blocking Data Structures Work?"

Lindaaker explained that "atomic" comes from Greek and meaning "undividable." He explained that a "lock-free data structure" is "a data structure that does not block any threads when performing an operation on the data structure (read or write)." He stated that one wants to avoid "spin-waiting" whenever possible.

Lindaaker talked about synchronized regions. He said such regions "create a serialized path through the code" and "guarantee safe publication." He defined "safe publication" as meaning "everything written before exiting synchronized [block]" and "guaranteed to be visible on entry of synchronized [block]." One of his bullets stated, "volatile fields give you safe publication without serialization." Lindaaker focused more on the volatile keyword modifier in his "volatile fields" slide.

The slide "What is a memory barrier?" provided a simple visual representation of the memory barrier concept.

For his slide "Atomic updates," Lindaaker stated that the easiest way to access an atomic reference is via use of java.util.concurrent.atomic.AtomicReference<V>. Lindakker provided a physical demonstration using coasters to illustrate the difference between compareAndSet (sets a value if the conditional matches favorably) and getAndSet. (sets new value returns old value).

Lindaaker prefers java.util.concurrent.atomic.AtomicReferenceFieldUpdater<T,V> because of its "lower memory overhead" ("fewer object headers") and "better memory locality" ("no reference indirection").

Lindaaker explained that array-based queues do block (sometimes a benefit when amount of work needs to be limited due to finite hardware resources), linked queues do not block. Lindaaker used a supermarket queue as an example of the differences. In the link-based queue, you always stand behind the same customer in front of you in the queue. In the array-based queue, you always remain in the same position. Bounded queues "frequently perform better," but will block when full.

One of the main themes of this presentation was the idea of learning new ideas and then individually researching them further. Lindaaker recommended that audience members look at the JDK's code to see some impressive and less impressive code examples.

Lindaaker referenced LMAX (London Multi Asset Exchange) Disruptor as an example of a "ring buffer" ("array with a read mark and a write mark"). He stated that "readers contend on the read mark, writers on write mark" and highlighted the consequence of this, "With single reader / single writer, there is no contention." The Disruptor page describes Disruptor as a "High Performance Inter-Thread Messaging Library."

Lindaaker stated that java.util.concurrent.ConcurrentHashMap is a good general choice, but is not very exciting for discussion in his presentation. He stated that it "scales reasonably well on current commodity hardware" (fewer than 100 CPUs) with proper tuning.

Neo Technology provides a database implementation (Neo4j) that is not relational (graph database). Lindaaker described the Neo Technology's graph-based database offering as, "Stores data as nodes and relationships between nodes."

Chủ Nhật, 30 tháng 9, 2012

JavaOne 2012: JavaOne Technical Keynote

Mark Reinhold started off the JavaOne 2012 Technical Keynote. He said this year's edition would be a little different because it would use largely the same example to illustrate various aspects of Java rather than standalone individual coverage of each component of Java. Richard Bair and Jasper Potts of the JavaFX team (and associated with FXExperience) introduced this example application, a schedule builder with presentation and speaker data from this year's JavaOne.

As part of the introduction of the example application, the presenters made extra effort to point out that Oracle is shipping the JVM for MacOS and that OpenJDK is what is being used in the example. They also stated that the example runs on Linux as well. They used Java SE 7 and JavaFX 2 for this application and they talked about the availability of SceneBuilder for building a JavaFX application. They demonstrated the use of SceneBuilder within NetBeans to generate the JavaFX-based login page.

Other interesting JavaFX advancements mentioned include the addition of a ComboBox (though there is no Date Picker yet), interoperability with SWT, and the availability of a JavaFX Packager. It was also mentioned that JavaFX was architected and designed from the beginning to allow for the main UI thread to be separate from background threads, allowing it to take advantage of multiple CPUs.

Bair showed the relatively verbose code that would be required to implement a JavaFX application to fully take advantage of multiple threads today. Brian Goetz came to the stage to describe how Project Lambda and the changes to the Java language will enable "better parallel libraries." Goetz said that the easiest way to help developers is to give them better libraries, but the language must sometime be extended when the limits of the language prevent libraries from being written to fully satisfy the need.

Goetz stated that the goals of inner classes are the same as Project Lambda, but inner classes have "a whole lot of other baggage." Goetz added that bulk operations on collections may not "really be needed, but things are better this way." Goetz then showed a simple but highly illustrative example of how Project Lambda changes how we process bulk data changes in a collection. His slide showed the J2SE 5 enhanced for loop is used today but can be done with the forEach method (added to all of the collections via the new default implementation interface approach) and a Groovy-like closure syntax (->).

Goetz's next slide was even more impressive. He showed what appeared to be three operations being performed on a collection as it was iterated. However, he pointed out that these would all be enacted at once on the collection with only a single traversal of that collection. All I could think was, "Wow!" Goetz also had a slide showing off the computeIfAbsent operation on collections. He ended by saying there's still lots of work to do and citing two URLs for playing with Project Lambda: http://openjdk.java.net/projects/lambda/ and http://jdk8.java.net/lambda/.

There was some interesting discussion on the differences between traditional Java environments and embedded environments. Raspberry Pi received multiple and prominent mentions.

Reinhold started talking about modularity and Project Jigsaw and showed a "little bit of a spaghetti diagram that is way cleaner than where we started, which was a total spaghetti diagram." He used this as a starting point for discussing the controversial decision to boot Project Jigsaw from Java 8 to Java 9.

Reinhold had a slide focused on things that are in Java 8 such as Project Lambda, Compact Profiles, Type Annotations, Project Nashorn, and the new Date/Time API. Reinhold added that "all this work is being done in OpenJDK" and that "all the specification work is being done in the JCP."

Arun Gupta had the unenviable task of beginning his presentation at the time the keynote was scheduled to end (7 pm local time). He talked about Java EE and showed a slide titled, "Java EE Past, Present, & Future." This slide showed how Java EE has added features since the ten specifications of J2EE 1.2 in December 1999. Gupta had another slide talking about "Java EE 7 Revised Scope" and how it increases productivity (via less boilerplate code with richer functionality and more defaults) and adds HTML5 support (WebSocket, JSON, and HTML5 Forms).

Another Gupta slide was titled "Java EE 7 - Candidate JSRs" that listed JSRs that are all new to Java EE 7 as well as those being modified. He then focused individual slides on some of them. His "Java API for RESTful Web Services 2.0" slide talked about a standarized approach using a client API. Gupta's slides showing how this is done today (without libraries) and comparing it to the next client API demonstrated how much simpler this is going to be.

Gupta's coverage of JMS 2.0 included discussion of less verbosity in JMS thanks to annotations and other new features in the Java programming language. He mentioned that the required resource adapter will make it easier to "mix and match" JMS providers in the future. Gupta showed a slide full of small-font code ("this code is not meant to be readable") demonstrating sending a message using JMS 1.1. This was followed with a slide showing significantly less (and much clearer) code in JMS 2.0 taking advantage of annotations and resource injection to send a message.

Gupta's coverage of the JSON support to be added to Java EE included the bullet "API to parse, generate, transform, query, etc. JSON." He then showed some slides with example JSON-formatted data and example code for using builder-style to access the JSON. It felt a lot like Groovy's JSON handling.

Java API for WebSocket 1.0 will allow annotations to be used to easily work with WebSocket. When covering Bean Validation 1.1, Gupta pointed out that not all new adopted JSRs are being led by Oracle. He showed using the built-in @NotNull annotation on method parameters, but also showed that one will be able to write custom constraints that can be similarly applied to method arguments.

Gupta highlighted miscellaneous improvements to Java EE such as JPA 2.1, EJB 3.2, etc. The majority of these JSRs have early public drafts available. GlassFish 4 is the reference implementation of Java EE 7 and already includes WebSocket, JSON, JMS 2, and more.

One of Gupta's slides was focused on Avatar. The "Angry Bids" example application was demonstrated. It is based on Avatar and runs on GlassFish and uses standard Java EE 7 components.

Gupta introduced Project Easel for NetBeans. It was mentioned that NetBeans 7.3 beta would be coming out later this week and will include support for HTML5 as a new project type. The example being showed uses JQuery and CSS. The NetBeans-based example communicated through Google Chrome to WebKit (it also works with the JavaFX-embedded browser), but it is expected to work eventually with any WebKit-based browser or device. The demonstrator showed how his changes to HTML5 code (HTML, JavaScript, and CSS) within NetBeans were updated in the Google Chrome browser. It was pretty impressive and makes me wish I had enough time to have accepted an invitation to provide early testing of NetBeans 7.3. NetBeans is going to be able to generate RESTful clients, support JQuery, and provide a Project Nashorn editor. A similar demo to this one is available at http://netbeans.org/kb/docs/web/html5-gettingstarted-screencast.html.

Like the Strategy Keynote, this Technical Keynote was held in the Masonic Auditorium. One of the interesting trends I noticed in tonight's keynotes was that at least three different people from three different organizations mentioned looking for skilled Java developers should contact them if interested in job opportunities.

JavaOne 2012: Java Strategy Keynote and IBM Keynote

I had a rough start to JavaOne 2012 similar to that at JavaOne 2010. It took 70 minutes for the people handling the check-in to provide me with a JavaOne badge due to "computer and printer technical difficulties." Although I'm not the most patient person in the world, the part of this that was even more disappointing than the wait is that I missed being part of the "Community Session: For You - By You: Growing the NetBeans Community" panel at NetBeans Community Day at JavaOne 2012, something I was really looking forward to attending and participating in. I had arrived at Moscone West about 15 minutes before that panel was to begin, but did not end up getting my badge until well after the panel was over. In a disappointed mood, I headed to the Nob Hill Masonic Center (AKA Masonic Auditorium, AKA California Masonic Memorial Temple) on Nob Hill to attend the initial evening's keynote address.

Java Strategy Keynote

The first announcement was to "turn off all electronic devices." After that announcement, a video was shown. I was happy that it was short. Hassan Risvi introduced the theme for JavaOne 2012: "Make the Future Java." He showed slides indicating the 2012 Scorecard for three areas of Java's strategy: technical innovation, community involvement, and Oracle leadership.

Georges Saab stated that Oracle has made Java available for more new platforms in the past year with JDK 7 than added in the previous ten years. He highlighted JDK 7's adoption and talked about OpenJDK. One feature of JDK 8 that he highlighted is Project Nashorn, a JavaScript implementation taking advantage of invokedynamic for high performance with high interoperability with Java and the JVM. He announced that Project Nashorn will be contributed to OpenJDK. He stated that IBM, RedHat, and Twitter have already expressed support for Project Nashorn as part of OpenJDK.

Dierk König of Canoo and Navis were guest speakers at this Strategy Keynote. They talked about their use of JavaFX and the Canoo Dolphin project being open sourced.

Nandini Ramani talked about JavaFX and stated that its now available for all major platforms. She also cited the release of NetBeans 7.2 with integrated SceneBuilder as part of improved tooling. She also reminded the audience that JavaFX is now bundled with current versions of Java. Ramani announced that JavaFX is now available for Linux ARM. She mentioned that 3D is coming to JavaFX. It was also mentioned in this keynote that they expect JavaFX to be fully open source by the end of the calendar year.

AMD's Phil Rogers talked about hardware trends moving from single-core CPUs to multi-core CPUs to GPUs using "a single piece of silicon and shared memory." Saab and Rogers stated that Project Sumatra allows the JVM to be modified so that Java developers can take advantage of new features in the hardware with existing Java language skills. The JVM will be able to decide whether to run the Java code on a multi-CPU or multi-processor.

Ramani returned to the stage and mentioned two new recently announced releases: Java ME Embedded 3.2 and Java Embedded Suite 7.0. Axel Hansmann of Cinterion talked about his company's use of Java ME Embedded.

Marc Brule of the Royal Canadian Mint joined Ramani on stage to talk about their use of Java Card: MintChip ("The Evolution of Currency").

Cameron Purdy came to the stage to discuss Java EE. Purdy announced that the earliest releases of Java EE 7 SDK can be downloaded via GlassFish versions. Purdy also announced that GlassFish 4 already includes significant HTML 5 additions mentioned at JavaOne 2011. Purdy pointed out that NoSQL is not standardized yet ("you could call it 'No Standard Databases'") and pointed out that JPA already supports MongoDB and Oracle NoSQL with planned support for Cassandra and other NoSQL implementations. Purdy stated that April 2013 is the currently planned timeframe for release of Java EE 7.

Nicole Otto of Nike joined Purdy on stage and showed a brief video (FuelBand: "Life is a Sport: Make It Count"). She talked about Java EE being used to track data on activity. Purdy had a slide "Java EE 8 and beyond" that was sub-titled: "Standards-based cloud programming model."

A short film was shown to introduce Dr. Robert Ballard (now I know why we were given the Alien Deep DVD upon entrance to the keynote). Dr. Ballard talked about his discovery of the Titanic and explained how the technology used for that discovery was like tying two tin cans together compared to the technology available today. The most laughter and applause of the night came to his statement that he hoped to find a spaceship in his explorations so that he never has to talk about discovering the Titanic again. Dr. Ballard stated that we should not sell science or engineering but should make it more personal to kids and sell scientists and engineers. He stated that "the battle for a scientist of engineer is over by the eighth grade."

IBM Keynote: (hardware,software)–>{IBM.java.patterns}

We moved, without break, directly into the IBM Keynote. Jason McGee (blog), an IBM representative, talked about "some of the things we've seen related to Java and the cloud." He talked about "Java Challenges" as "share more," "cooperate," "use less" (resources), exploit technology. John Duimovich came to the stage to talk more about these four challenges "in context on the Java Virtual Machine."

Duimovich talked about "shared classes cache" and AOT (Ahead of Time), described as "JIT code saved for next JVM" to use. Duimovich also talked about multi-tenancy and supporting "isolation within a single JVM." He had a slide on the Liberty Profile "for Web, OSGi, and Mobile Apps."

Duimovich introduced "really cool hardware" called System z and explained the advantages of running Java (rather than C or C++) on this hardware. Duimovich stated that "Oracle and Java team together on Java, but compete head to head." He pointed out that this "competition drives innovation" and is good for customers and developers.

McGee returned to the stage to talk about a few more themes, observations, and trends. He pointed out that "Java provides developers abstraction from underlying hardware," but that "hardware is changing and evolving rapidly." McGee's slide stated that "both Java and Cloud need to enable the exploitation of these hardware advances while still preserving the 'run anywhere' benefit."

Another McGee slide was titled "Java in a ploygot world..." and he used this slide to talk about the world transitioning from an all-Java enterprise world to today with applications written in numerous languages. He mentioned several alternative JVM-based languages and put a plug in for IBM's X10 language. McGee believes that Java will be part of, but not all of, future enterprise applications.

Thứ Ba, 18 tháng 9, 2012

Packt Publishing's 1000th Title: Surprise Gifts

Packt Publishing published its first book in 2004 and is about to publish its 1000th book. Along the way, Packt Publishing has donated a portion of revenue to the open source projects covered by its books. As part of their celebration of publishing their 1000th title, Packt Publishing has a "surprise gift" for anyone who has registered with them or has an account with them on 30 September 2012.

This is the information Packt Publishing provided to me related to this celebration:

To celebrate this event with our readers, we'd be gifting them with not one but two assured surprises which would be revealed to them by the 30th of September, 2012. Anyone who is already registered or signs up for a free Packt account before 30th September 2012 is guaranteed a surprise gift.

I have received electronic copies of Packt Publishing books in the past as part of book reviews. The books I reviewed are JBoss AS 7 Configuration, Deployment and Administration, Java EE 6 Cookbook for Securing, Tuning, and Extending Enterprise Applications, and Java EE 6 Development with NetBeans 7. In addition, I have purchased three electronic books from Packt Publishing (Groovy for Domain-Specific Languages, Learning jQuery, and Java 7 New Features Cookbook).

Packt Publishing has offered me an electronic book for promoting this celebration event and I am having a difficult time choosing from many selections that look interesting including Grails 1.1 Web Application Development, GlassFish Security, Java 7 Concurrency Cookbook, Akka Essentials, and Java EE 6 with GlassFish 3 Application Server.