<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sellmic.com &#187; Software Development</title>
	<atom:link href="http://sellmic.com/blog/category/software-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://sellmic.com/blog</link>
	<description>Augusto's corner of art, code and fun</description>
	<lastBuildDate>Sun, 24 Jul 2011 06:25:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Hidden Java 7 Features &#8211; System and Process CPU Load Monitoring</title>
		<link>http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/</link>
		<comments>http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 04:10:28 +0000</pubDate>
		<dc:creator>Augusto</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://sellmic.com/blog/?p=612</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/' addthis:title='Hidden Java 7 Features &#8211; System and Process CPU Load Monitoring' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div>A couple of weeks ago I wrote a summary of 7 new cool features in Java 7. Others have written great blog posts about them, so I was thinking it might be useful for me to focus on lesser known or &#8220;Hidden Java 7 Features&#8221;. In the next few weeks, I&#8217;ll try to explore and [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/' addthis:title='Hidden Java 7 Features &#8211; System and Process CPU Load Monitoring ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/' addthis:title='Hidden Java 7 Features &#8211; System and Process CPU Load Monitoring' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div><p style="text-align: center;"><a href="http://sellmic.com/blog/wp-content/uploads/2011/07/java-duke-as-indiana-jones-treasure-med.jpg"><img class="aligncenter" title="Duke Indy finds treasure in latest release! (or 'Raiders of the Lost Classpath', thanks to Dan Salt for suggesting that title)" src="http://sellmic.com/blog/wp-content/uploads/2011/07/java-duke-as-indiana-jones-treasure-med.jpg" alt="" width="589" height="372" /></a></p>
<p>A couple of weeks ago I wrote a summary of <a href="http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/">7 new cool features in Java 7</a>. Others have <a href="http://loianegroner.com/2011/07/new-java-7-language-features/">written</a> great <a href="http://www.phphosts.org/2011/07/java-se-7-brings-better-file-handling-than-ever-to-groovy/">blog</a> <a href="http://techiedan.com/2011/03/15/java-7-new-try-catch-blocks/">posts</a> about them, so I was thinking it might be useful for me to focus on lesser known or &#8220;Hidden Java 7 Features&#8221;. In the next few weeks, I&#8217;ll try to explore and write a series of blog posts about them.</p>
<p><strong>System and Process CPU Load Monitoring</strong></p>
<p>Java 7 provides a new MBean that finally allows Java developers to access overall System and current process CPU load monitoring. This feature is not really that hidden as it&#8217;s listed in the <a href="http://openjdk.java.net/projects/jdk7/features/#fa530068">what&#8217;s new page for JDK 7</a>, but I haven&#8217;t really noticed a lot of talk about it and I certainly overlooked it initially.</p>
<p>The interface <a href="http://download.java.net/jdk7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html">com.sun.management.OperatingSystemMXBean</a>, has two new methods that easily get this information; <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; white-space: pre;"><a href="http://download.java.net/jdk7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html#getSystemCpuLoad()">getSystemCpuLoad()</a> </span>and <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; white-space: pre;"><a href="http://download.java.net/jdk7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html#getProcessCpuLoad()">getProcessCpuLoad()</a></span>. Both methods return the load as a double value in the [0.0,1.0] interval, with 0.0 representing no load to 1.0 representing 100% CPU load for the whole system or the current JVM process respectively.</p>
<p>It&#8217;s pretty easy to get access to this MBean;</p>
<pre class="java" name="code">import com.sun.management.OperatingSystemMXBean;
...
OperatingSystemMXBean osBean = ManagementFactory.getPlatformMXBean(
                OperatingSystemMXBean.class);
// What % CPU load this current JVM is taking, from 0.0-1.0
System.out.println(osBean.getProcessCpuLoad());

// What % load the overall system is at, from 0.0-1.0
System.out.println(osBean.getSystemCpuLoad());</pre>
<p><strong>Wasn&#8217;t this already available?</strong><br />
Java 6 introduced a new method in java.lang.management.OperatingSystemMXBean called <a href="http://download.oracle.com/javase/6/docs/api/java/lang/management/OperatingSystemMXBean.html#getSystemLoadAverage()">getSystemLoadAverage()</a>, which could get the CPU average for the overall system (there wasn&#8217;t a mechanism for the JVM/current process load). However this <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6336608">doesn&#8217;t seem to work on Windows</a> and would just return a -1 (tried this with Java 7 in Windows 7 and that is still the case).</p>
<p>Other ways of doing this prior to Java 7 would include Java APIs implemented via native libraries like <a href="http://support.hyperic.com/display/SIGAR/Home">SIGAR</a>, which are good alternatives but obviously not part of the standard Java distribution, or may not support most platforms.</p>
<p><strong>Now the bad news</strong><br />
If you notice in my code I use <a href="http://download.oracle.com/javase/7/docs/jre/api/management/extension/com/sun/management/OperatingSystemMXBean.html">com.sun.management.OperatingSystemMXBean</a>, not <a href="http://download.oracle.com/javase/7/docs/api/java/lang/management/OperatingSystemMXBean.html?is-external=true">java.lang.management.OperatingSystemMXBean</a> which means the methods getSystemCpuLoad() and getProcessCpuLoad() are not part of the official, supported public interface of the Java Platform. <a href="http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html">Oracle actually discourages the use of these packages</a>, since they could be removed in future releases or may not be available in all JVM implementations.</p>
<p>I&#8217;m not 100% sure why these methods were only added to the com.sun version of OperatingSystemMXBean. Initially I thought it was because Oracle didn&#8217;t want to add a method to a public interface (which would break any code implementing that interface), however Java 6 added getSystemLoadAverage(). If anybody has any insight on this, please let me know.</p>
<p>There are ways to use these new methods without having a hard dependency to these com.sun classes (for example via reflection, or using JMX conventions), I may cover these in a future blog post or update to this one.</p>
<p><strong>Demo, JCPUMon</strong><br />
Finally, I wanted to do a simple UI that would use this feature to have a little widget to monitor system CPU and current process load graphically. I call it &#8220;JCPMon&#8221;, it can be launched as a standalone Java application, run inside an application you want to monitor or just used as a Swing component in a Java UI.</p>
<p><a href="http://sellmic.com/blog/wp-content/uploads/2011/07/JCPUMon1.jpg"><img class="aligncenter size-full wp-image-630" title="JCPUMon - Java System and Process Monitoring Tool" src="http://sellmic.com/blog/wp-content/uploads/2011/07/JCPUMon1.jpg" alt="" width="450" height="281" /></a></p>
<p>The green part of the graph represents the overall system CPU load, while the yellow part represents the current process load, in this case CPU load imposed by the GUI (I did a lot of resizing to get a few yellow bars for this image <img src='http://sellmic.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ). If you want to monitor a Java application you already have, you can easily do so by calling;</p>
<pre class="java" name="code">
// This method won't block, so you can call it at the start of your program
com.sellmic.apps.monitoring.jcpumon.Main(null);

// And then continue doing anything else ...
</pre>
<p>Of course an improvement would be to have the ability to connect to an external process via JMX (remote or local).</p>
<p>You can launch this app via webstart, <a href="http://sellmic.com/lab/dev/jcpumon/launch.jnlp"><img src="http://java.sun.com/products/jfc/tsc/articles/swing2d/webstart.png"/></a>.You&#8217;ll need Java 7 to be installed.</p>
<p>This simple GUI uses this new Java 7 capability and also has some extras to configure the look of the UI (squares or circles, size, how often to update, always on top, full screen). If anybody is interested in the code for this let me know and I can setup a page to host it.</p>
<p><strong>UPDATE:</strong> JNLP URL was wrong, if you tried webstart before and it failed please try again. Sorry about that!</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/' addthis:title='Hidden Java 7 Features &#8211; System and Process CPU Load Monitoring ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://sellmic.com/blog/2011/07/21/hidden-java-7-features-cpu-load-monitoring/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>7 new cool features in Java 7</title>
		<link>http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/</link>
		<comments>http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/#comments</comments>
		<pubDate>Fri, 08 Jul 2011 21:53:17 +0000</pubDate>
		<dc:creator>Augusto</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[java 7]]></category>
		<category><![CDATA[jdk 7]]></category>

		<guid isPermaLink="false">http://sellmic.com/blog/?p=515</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/' addthis:title='7 new cool features in Java 7' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div>The evolution of the Java language and VM continues! Mark Reinhold (Chief Architect of the Java Platform Group) announced yesterday that the first release candidate for Java 7 is available for download, he confirms that the final released date is planned for July 28. For a good overview of the new features and what&#8217;s coming [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/' addthis:title='7 new cool features in Java 7 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/' addthis:title='7 new cool features in Java 7' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div><p><a href="http://sellmic.com/blog/wp-content/uploads/2007/01/duke_evolution.png"><img class="aligncenter size-full wp-image-24" title="Evolving to Java 7" src="http://sellmic.com/blog/wp-content/uploads/2007/01/duke_evolution.png" alt="" width="450" height="209" /></a></p>
<p>The evolution of the Java language and VM continues! Mark Reinhold (Chief Architect of the Java Platform Group) <a href="http://mreinhold.org/blog/jdk7-rc"> announced yesterday</a> that the first release candidate for Java 7 is <a href="http://jdk7.java.net/download.html"> available for download</a>, he <a href="https://twitter.com/#!/mreinhold/status/89049145041625088">confirms</a> that the final released date is planned for July 28.</p>
<p>For a good overview of the new features and what&#8217;s coming next in Java 8, <a href="http://medianetwork.oracle.com/media/show/16796">I recommend this video on the Oracle Media Network</a>, which features Adam Messinger, Mark Reinhold, John Rose and Joe Darcy. I think Mark sums up Java 7 very well when describing it as an evolutionary release, with good number &#8220;smaller&#8221; changes that make for a great update to the language and platform.</p>
<p>I had a chance to play a bit with the release candidate (made easier by the Netbeans 7  JDK 7 support!), and decided to list 7 features (<a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/enhancements.html">full list is here</a>) I&#8217;m particularly excited about. Here they are;</p>
<p><strong>1. Strings in switch Statements (<a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html">doc</a>)</strong></p>
<p>Did you know previous to Java 7 you could only do a switch on <em>char</em>, <em>byte</em>, <em>short</em>, <em>int</em>, <em>Character</em>, <em>Byte</em>, <em>Short</em>, <em>Integer</em>, or an <em>enum </em>type (<a href="http://java.sun.com/docs/books/jls/third_edition/html/statements.html">spec</a>)? Java 7 adds Strings making the switch instruction much friendlier to String inputs. The alternative before was to do with with if/else if/else statements paired with a bunch of String.equals() calls. The result is much cleaner and compact code.</p>
<pre class="java" name="code">    public void testStringSwitch(String direction) {
        switch (direction) {
             case "up":
                 y--;
             break;

             case "down":
                 y++;
             break;

             case "left":
                 x--;
             break;

             case "right":
                 x++;
             break;

            default:
                System.out.println("Invalid direction!");
            break;
        }
    }</pre>
<p><strong>2. Type Inference for Generic Instance Creation (<a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html">doc</a>)</strong></p>
<p>Previously when using generics you had to specify the type twice, in the declaration and the constructor;</p>
<pre class="java" name="code">List&lt;String&gt; strings = new ArrayList&lt;String&gt;();</pre>
<p>In Java 7, you just use the diamond operator without the type;</p>
<pre class="java" name="code">List&lt;String&gt; strings = new ArrayList&lt;&gt;();</pre>
<p>If the compiler can infer the type arguments from the context, it does all the work for you. Note that you have always been able do a &#8220;<em>new ArrayList()</em>&#8221; without the type, but this results in an unchecked conversion warning.</p>
<p>Type inference becomes even more useful for more complex cases;</p>
<pre class="java" name="code">// Pre-Java 7
// Map&lt;String,Map&lt;String,int&gt;&gt;m=new HashMap&lt;String, Map&lt;String,int&gt;&gt;();

// Java 7
Map&lt;String, Map&lt;String, int&gt;&gt; m = new HashMap&lt;&gt;();</pre>
<p><strong>3. Multiple Exception Handling Syntax (<a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html">doc</a>)</strong></p>
<p><a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html"></a>Tired of repetitive error handling code in &#8220;exception happy&#8221; APIs like <em>java.io</em> and <em>java.lang.reflect</em>?</p>
<pre class="java" name="code">try {
    Class a = Class.forName("wrongClassName");
    Object instance = a.newInstance();
} catch (ClassNotFoundException ex) {
    System.out.println("Failed to create instance");
} catch (IllegalAccessException ex) {
    System.out.println("Failed to create instance");
} catch (InstantiationException ex) {
   System.out.println("Failed to create instance");
}</pre>
<p>When the exception handling is basically the same, the improved catch operator now supports multiple exceptions in a single statement separated by &#8220;|&#8221;.</p>
<pre class="java" name="code">try {
    Class a = Class.forName("wrongClassName");
    Object instance = a.newInstance();
} catch (ClassNotFoundException | IllegalAccessException |
   InstantiationException ex) {
   System.out.println("Failed to create instance");
}</pre>
<p>Sometimes developers use a &#8220;<em>catch (Exception ex)</em> to achieve a similar result, but that&#8217;s a dangerous idea because it makes code catch exceptions it can&#8217;t handle and instead should bubble up (IllegalArgumentException, OutOfMemoryError, etc.).<br />
<span id="more-515"></span><br />
<strong>4. The try-with-resources Statement (<a href="http://download.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html">doc</a>)</strong></p>
<p>The new try statement allows opening up a &#8220;resource&#8221; in a try block and automatically closing the resource when the block is done.</p>
<p>For example, in this piece of code we open a file and print line by line to stdout, but pay close attention to the finally block;</p>
<pre name="code" class="java">
        try {
            in = new BufferedReader(new FileReader("test.txt"));

            String line = null;
            while ((line = in.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException ex) {
            ex.printStackTrace();
        } finally {
            try {
                if (in != null) in.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
</pre>
<p>When using a resource that has to be closed, a finally block is needed to make sure the clean up code is executed even if there are exceptions thrown back (in this example we catch IOException but if we didn&#8217;t, finally would still be executed). The new try-with-resources statement allows us to automatically close these resources in a more compact set of code;</p>
<pre name="code" class="java">
       try (BufferedReader in=new BufferedReader(new FileReader("test.txt")))
       {
            String line = null;
            while ((line = in.readLine()) != null) {
                System.out.println(line);
            }
        } catch (IOException ex) {
            ex.printStackTrace();
        }
</pre>
<p>So &#8220;in&#8221; will be closed automatically at the end of the try block because it implements an interface called <a href="http://download.java.net/jdk7/docs/api/java/lang/AutoCloseable.html">java.lang.AutoCloseable</a>. An additional benefit is we don&#8217;t have to call the awkward IOException on close(), and what this statement does is &#8220;suppress&#8221; the exception for us (although there is a mechanism to get that exception if needed, <a href="http://download.java.net/jdk7/docs/api/java/lang/Throwable.html#getSuppressed()">Throwable.getSuppressed()</a>).</p>
<p><strong>5. Improved File IO API (docs <a href="http://download.oracle.com/javase/7/docs/technotes/guides/io/enhancements.html#7">1</a>, <a href="http://download.oracle.com/javase/tutorial/essential/io/notification.html">2</a>)</strong></p>
<p>There are quite a bit of changes in the java.nio package. Many are geared towards performance improvements, but long awaited enhancements over java.io (specially java.io.File) have finally materialized in a new package called <a href="http://download.java.net/jdk7/docs/api/java/nio/file/package-summary.html#package_description">java.nio.file</a>.</p>
<p>For example, to read a small file and print all the lines (see example above);</p>
<pre name="code" class="java">
       List&lt;String&gt; lines =  Files.readAllLines(
       FileSystems.getDefault().getPath("test.txt"), StandardCharsets.UTF_8);

       for (String line : lines) System.out.println(line);
</pre>
<p><em>java.nio.file.Path</em> is an interface that pretty much serves as a replacement for <em>java.io.File</em>, we need a <em>java.nio.file.FileSystem </em>to get paths, which you can get by using the <em>java.nio.file.FileSystems</em> factory (getDefault() gives you the default file system).</p>
<p>java.nio.file.Files then provides static methods for file related operations. In this example we can read a whole file much more easily by using readAllLines(). This class also has methods to create symbolic links, which was impossible to do pre-Java 7. Another feature long overdue is the ability to set file permissions for POSIX compliant file systems via the Files.setPosixFilePermissions method. These are all long over due file related operations, impossible without JNI methods or System.exec() hacks.</p>
<p>I didn&#8217;t have time to play with it but this package also contains a very interesting capability via the WatchService API which allows notification of file changes. You can for example, register directories you want to watch and get notified when a file is added, removed or updated. Before, this required manually polling the directories, which is not fun code to write.</p>
<p>For more on monitoring changes <a href="http://download.oracle.com/javase/tutorial/essential/io/notification.html">read this tutorial from Oracle</a>.</p>
<p><strong>6. Support for Non-Java Languages: invokedynamic (<a href="http://download.oracle.com/javase/7/docs/technotes/guides/vm/multiple-language-support.html">doc</a>)</strong></p>
<p>The first new instruction since Java 1.0 was released and introduced in this version is called invokedynamic. Most developers will never interact or be aware of this new bytecode. The exciting part of this feature is that it improves support for compiling programs that use dynamic typing. Java is statically typed (which means you know the type of a variable at compile time) and dynamically typed languages (like Ruby, bash scripts, etc.) need this instruction to support these type of variables.</p>
<p>The JVM already supports many types of non-Java languages, but this instruction makes the JVM more language independent, which is good news for people who would like to implement components in different languages and/or want to inter-operate between those languages and standard Java programs.</p>
<p><strong>7. JLayerPane (<a href="http://download.oracle.com/javase/tutorial/uiswing/misc/jlayer.html">doc</a>)</strong></p>
<p>Finally, since I&#8217;m a UI guy, I want to mention JLayerPane. This component is similar to the one provided in the JXLayer project. I&#8217;ve used JXLayer many times in the past in order to add effects on top of Swing components. Similarly, JLayerPane allows you to decorate a Swing component by drawing on top of it and respond to events without modifying the original component.</p>
<p>This example from the JLayerPane tutorial shows a component using this functionality, providing a &#8220;spotlight&#8221; effect on a panel.</p>
<p><a href="http://sellmic.com/blog/wp-content/uploads/2011/07/jlayer-spotlight.png"><img src="http://sellmic.com/blog/wp-content/uploads/2011/07/jlayer-spotlight.png" alt="" title="jlayer-spotlight" width="300" height="200" class="aligncenter size-full wp-image-603" /></a></p>
<p>You could also blur the entire window, draw animations on top of components, or create transition effects.</p>
<p>And that&#8217;s just a subset of the features, Java 7 is a long overdue update to the platform and language which offers a nice set of new functionality. The hope is the time from Java 7 to 8 is a lot shorter than from 6 to 7!</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/' addthis:title='7 new cool features in Java 7 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://sellmic.com/blog/2011/07/08/7-new-cool-features-in-java-7/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Goodbye JavaFX Script, hello JavaFX 2.0</title>
		<link>http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/</link>
		<comments>http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 06:19:01 +0000</pubDate>
		<dc:creator>Augusto</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[javafx]]></category>

		<guid isPermaLink="false">http://sellmic.com/blog/?p=415</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/' addthis:title='Goodbye JavaFX Script, hello JavaFX 2.0' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div>JavaFX Script is officially dead. Oracle has decided to continue investing in JavaFX as the UI platform for Java client applications, but at the same time they&#8217;ve realized that the JavaFX Script language was probably a limiting factor in the general adoption of their RIA technology. History On November 8, 2006, Sun engineer Chris Oliver [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/' addthis:title='Goodbye JavaFX Script, hello JavaFX 2.0 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/' addthis:title='Goodbye JavaFX Script, hello JavaFX 2.0' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div><p><img class="alignnone size-full wp-image-417" title="Goodbye JavaFX Script, we hardly knew ye" src="http://sellmic.com/blog/wp-content/uploads/2010/09/goodbye_javafx_script1.jpg" alt="Goodbye JavaFX Script, we hardly knew ye" width="589" height="340" /></p>
<p><a href="http://en.wikipedia.org/wiki/JavaFX_Script">JavaFX Script</a> is <a href="http://www.dzone.com/links/r/oracle_to_discontinue_javafx_script_will_use_java.html">officially dead</a>.</p>
<p>Oracle has decided to continue investing in JavaFX as the UI platform for Java client applications, but at the same time they&#8217;ve realized that the JavaFX Script language was probably a limiting factor in the general adoption of their RIA technology.</p>
<p><strong>History</strong></p>
<p>On November 8, 2006, Sun engineer Chris Oliver published an <a href="http://blogs.sun.com/chrisoliver/entry/f3">entry in his blog</a> introducing a project he had been working on called &#8220;F3&#8243;. His <a href="http://blogs.sun.com/chrisoliver/entry/f3">blog entry</a> explained the general concepts behind the project;</p>
<blockquote><p>My name is Chris Oliver. I came to Sun through their acquisition of Seebeyond in September 2005. I&#8217;d like to present something about my current work – it’s not public yet but it should be open-sourced on java.net shortly.</p>
<p>My project is called F3 which stands for “Form follows function”, and its purpose was to explore making GUI programming easier in general.</p>
<p>F3 is actually a declarative Java scripting language with static typing for good IDE support and compile-time error reporting (unlike JavaScript&#8230;), type-inference, declarative syntax, and automatic data-binding with full support for 2d graphics and standard Swing components as well as declarative animation. You can also import java classes, create new Java objects, call their methods, and implement Java interfaces.</p></blockquote>
<p>Chris&#8217; first blog post on F3 introduced code snippets showing off the main features of the language, and a <a href="http://blogs.sun.com/chrisoliver/entry/more_f3_demos">follow up post had a set of very impressive demos</a> meant to show off the language and how it could compete with other RIA technologies like Flash.</p>
<p>At <a href="http://sellmic.com/blog/2007/05/08/javafx/">JavaOne 2007 F3 was rebranded as JavaFX Script</a>, and we were shown some cool demos, like this <a href="http://sellmic.com/blog/2007/05/11/javafx-pdf-viewer-demo/">JavaFX PDF Reader</a> which unfortunately was never released.</p>
<p><a href="http://sellmic.com/blog/2008/12/04/javafx-is-here/"> JavaFX 1.0 was released on December, 2008</a>.</p>
<p>At JavaOne 2009,<a href="http://sellmic.com/blog/2009/06/05/javafx-authoring-tool-demo-at-javaone-2009-with-video/"> Sun showed off a much needed JavaFX designer tool</a>. The demo showed how the tool would allow for visual design of JavaFX applications on different &#8220;screens&#8221; (desktop, mobile, TV, etc.). This tool hasn&#8217;t been released to the public, instead there&#8217;s a more developer oriented Netbeans plugin with Matisse like UI design capabilities that was released a while ago.</p>
<p><strong>But it&#8217;s not Java</strong></p>
<p>The complaint I would often hear from developers when talking about JavaFX is that it was not Java. Unlike Java, F3 was designed from the beginning with UIs in mind. Chris Oliver wanted the flexibility of a declarative language, and decided that XML was not the best fit for this, thus the need for the F3 language.</p>
<p>The problem was that the new language was very different from Java. <a href="http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/">I remember doing a JavaFX Script presentation for a JUG in Panama</a>, and even after having written a few programs in it, the context switch between it and Java was quite big for me.</p>
<p>At the last JavaOne I attended, I could overhear a lot of people rejecting the idea of learning yet another new language just to do a Java based UI. Not only a new language, but one that was so different from what they were used to. People often forget that one of the reasons Java dominates the development landscape today is because it was so similar to it&#8217;s predecessors; C and C++. While the benefits of a new UI focused language are many (the binding features alone in JavaFX Script are a good example), one thing that I&#8217;ve noticed is that modern UIs are being done in less exotic ways; just take a look at the UI framework in Android which is Java language based and on iPhone which uses Objective C.</p>
<p><strong>JavaFX technology in Java, and other languages</strong></p>
<p>Oracle has published the proposed <a href="http://javafx.com/roadmap/">roadmap for JavaFX 2.0</a>. The key standout feature listed there is <em>&#8220;Port JavaFX Script APIs to Java&#8221;</em>, which will make JavaFX not only easily available to Java developers but to those who use other dynamic languages like Scale, JRuby, Groovy, Javascript, etc. The roadmap also mentions<a href="http://openjdk.java.net/projects/lambda/"> support for lambda expressions (closures)</a>, which I can already see being very useful for UI programming.</p>
<p>There are other notable features listed there, like additional UI controls, web views and integration with HTML5, HD playback, etc. The roadmap mentions the binding API, I&#8217;m curious to see how it would be integrated in the core Java language.</p>
<p>I think Oracle has made the right move here, the JavaFX stack is already pretty advanced and shows a lot of promise. It should be used more, but was being hindered by the lack of adoption of JavaFX Script. Porting these APIs to Java, and supporting other dynamic languages should allow a lot more developers to leverage the power of JavaFX.</p>
<p>Sorry for the long post, but I wanted to include a bit of history at the beginning about F3. I wonder how Chris Oliver and the other engineers that worked so hard on the core JavaFX Script language feel about this development. Hopefully they feel pretty proud about their work, because even though the language is being dropped, it seems the core of JavaFX is pretty strong. Adoption should grow now that there is no &#8220;new language&#8221; excuse.</p>
<p>At least that&#8217;s what I&#8217;m hoping for.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/' addthis:title='Goodbye JavaFX Script, hello JavaFX 2.0 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://sellmic.com/blog/2010/09/21/goodbye-javafx-script-hello-javafx-2-0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Classpath hell just froze over</title>
		<link>http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/</link>
		<comments>http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 21:09:37 +0000</pubDate>
		<dc:creator>Augusto</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[classpath]]></category>
		<category><![CDATA[jigsaw]]></category>
		<category><![CDATA[jsr-277]]></category>
		<category><![CDATA[jsr-294]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[osgi]]></category>

		<guid isPermaLink="false">http://sellmic.com/blog/?p=276</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/' addthis:title='Classpath hell just froze over' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div>&#8220;The classpath is dead&#8220; &#8230; that&#8217;s what Mark Reinhold (Principal Engineer @ Sun) said at a general session during JavaOne 2009. It&#8217;s the type of statement that should resonate with any of us who have been victims of classpath/jar hell. Mark announced this in the context of reviewing the new language features due to be [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/' addthis:title='Classpath hell just froze over ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/' addthis:title='Classpath hell just froze over' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div><p style="text-align: center;"><a href="http://sellmic.com/gallery2/main.php?g2_itemId=8046"><img class="size-full wp-image-308 aligncenter" style="border: 1px solid gray;" title="Classpath Hell" src="http://sellmic.com/blog/wp-content/uploads/2009/06/classpath_hell.jpg" alt="Classpath Hell" width="589" height="399" /></a></p>
<p><em>&#8220;<strong>The classpath is dead</strong>&#8220;</em> &#8230; that&#8217;s what <a href="http://blogs.sun.com/mr/">Mark Reinhold</a> (Principal Engineer @ Sun) said at a general session during <a href="http://developers.sun.com/learning/javaoneonline/j1online.jsp?track=embedded&amp;yr=2009">JavaOne 2009</a>. It&#8217;s the type of statement that should resonate with any of us who have been victims of <a href="http://c2.com/cgi/wiki?ClasspathHell">classpath</a>/<a href="http://en.wikipedia.org/wiki/JAR_hell#JAR_hell">jar hell</a>. Mark announced this in the context of reviewing the new language features due to be released in <a href="https://jdk7.dev.java.net/">JDK 7</a> (ETA 2010) or more specifically the new Java module system codenamed <a href="http://openjdk.java.net/projects/jigsaw/">Jigsaw</a>.</p>
<h3>Module Systems and Jigsaw</h3>
<p>Jigsaw is a low level implementation of a module system, which also includes some language and VM changes that are specified in <a href="http://jcp.org/en/jsr/detail?id=294">JSR 294</a> (note that Jigsaw is being done outside of any JSR and is not a reference implementation of 294). Another implementation of a module system most Java developers are likely more familiar with is <a href="http://www.osgi.org/Main/HomePage">OSGi</a>. But what is a module system and why do we need one?</p>
<div id="attachment_322" class="wp-caption alignleft" style="width: 310px"><img class="size-full wp-image-322" title="Module dependencies" src="http://sellmic.com/blog/wp-content/uploads/2009/06/module_depencies.jpg" alt="Depencies on multiple versions (of module B in this example)" width="300" height="207" /><p class="wp-caption-text">Depencies on multiple versions (of module B in this example)</p></div>
<p>A module system enables <a href="http://en.wikipedia.org/wiki/Module_system">modular programming</a>, it allows developers to separate code into clearly defined modules that can specify what other modules they depend on and their versions, can be internally modified without breaking other modules that depend on it and can hide its own internals from external modules.</p>
<p>A module system can solve the classpath/jar hell problem by leveraging the previously mentioned features in order to allow an application to use the right versions of the set of libraries it requires. In the diagram shown here, we have an APP module that depends on the A, B and C modules. But module C also depends on B, however this dependency is to a different version of B than the one APP needs. A useful module system would then allow us to have 2 versions of the B module, with the compatible version and implementation visible to the appropriate modules (in this case APP and C).</p>
<p>Also, by clearly expressing module dependencies, we no longer have to look at random lib folders or hidden documentation when using a 3rd party library, just so we can guess what the corresponding jar files are needed to run it. With the system implemented by Jigsaw, we can simply introspect the module and let it tell us what those dependencies are. It takes the guesswork and the dark magic completely out of the equation.</p>
<p>But back to Mark&#8217;s presentation at the general session. The main reasons to introduce Jigsaw into JDK 7 are the following:</p>
<ul>
<li>Eliminate classpath complexity (classpath/jar hell problem already discussed).</li>
<li>Increase performance. The VM download size can be made smaller, and startup time should improve because for small programs (say HelloWorld) unnecessary classes don&#8217;t have to be loaded at all. Mark showed how he could run HelloWorld by only using 2 modules listed by the new <strong>jmod</strong> command; <strong>jdk.base@7-ea</strong> and <strong>jdk.boot@7-ea</strong>.</li>
<li>Enable native integration for installing modules.</li>
</ul>
<p><span id="more-276"></span>Mark demonstrated that last point by showing a demo of him installing various JDK packages via the Synaptic Package Manager.</p>
<div id="attachment_327" class="wp-caption aligncenter" style="width: 460px"><img class="size-full wp-image-327" title="Synaptic Package Manager" src="http://sellmic.com/blog/wp-content/uploads/2009/06/synaptic_package_manager.jpg" alt="Installing Java modules via Synaptic Package Manager" width="450" height="258" /><p class="wp-caption-text">Installing Java modules via Synaptic Package Manager</p></div>
<h3>Alex Buckley&#8217;s presentation</h3>
<p>I attended <a href="http://www.doc.ic.ac.uk/~abuckley/">Alex Buckley</a>&#8216;s (Computational Theologist @ Sun) session on <a href="http://developers.sun.com/learning/javaoneonline/sessions/2009/pdf/TS-4954.pdf">&#8220;Modularity in the Java Programming Language: JSR 294 and beyond&#8221;</a>, which had a lot more details on the specific language changes to be implemented in order to support this new feature.</p>
<p>The most noticeable aspect of this is the introduction of <em><strong>module-info.java</strong></em>. This file goes at the top of your module filesystem, and is the class that specifies at compile and runtime the definition of the module. Here is an example, coming from Alex&#8217;s slides;</p>
<pre name="code" class="java">module org.planetjdk.aggregator {
          system jigsaw;
          requires module jdom;
          requires module tagsoup;
          requires module rome;
          requires module rome-fetcher;
          requires module joda-time;
          requires module java-xml;
          requires module java-base;
          class org.planetjdk.aggregator.Main;
 }</pre>
<p>Our module is &#8220;<em>org.planetjdk.aggregator</em>&#8221; and uses the jigsaw module system. Depenencies are denoted by using <em>requires </em>and providing the module name, Alex calls this part of the module metadata the &#8220;<em>logical classpath</em>&#8221; of the module. You can also define the main class for the module which in this case is &#8220;<em>org.planetjdk.aggregator.Main</em>&#8220;.</p>
<p>You&#8217;ll also notice that the module name is quite long &#8220;org.planetjdk.aggregator&#8221;, while the list of required modules uses shorter names. This can be done by supplying a module alias. In the previous example, we could have added the line;</p>
<pre name="code" class="java">provides module aggregator;</pre>
<p>This would then allow other modules to say &#8220;<em>requires module aggregator</em>&#8221; and successfully link to this module by this shorter form of the name.</p>
<p>Also, you can specify your module version and version dependencies in <em>module-info.java</em>. This updated example illustrates this mechanism;</p>
<pre name="code" class="java">module org.planetjdk.aggregator @ 1.0 {
          system jigsaw;
          requires module jdom @ 1.*;
          requires module tagsoup @ 1.2.*;
          requires module rome @ =1.0;
          requires module rome-fetcher @ =1.0;
          requires module joda-time @ [1.6,2.0);
          requires module java-xml @ 7.*;
          requires module java-base @ 7.*;
          class org.planetjdk.aggregator.Main;
}</pre>
<p>Note also that you can only have one <em>module-info.java</em> per module, in only one location, so if you have a big source tree and you want to create multiple modules from it you will have to either separate your source into different trees or use some creative scripting to accomplish this at build time. I believe Mark mentioned they had to use some scripted solution for the jdk base as I believe it's one tree.</p>
<p>The rest of Alex's presentation focused on how to locate modules at compile and runtime by using the "<em>modulepath</em>", the use of the new module keyword and how it affects accessibility, and he gives a glimpse as to how they plan to support other module systems (for example, the version notation can be different when using other module systems).</p>
<p>This is all better explained in Alex's slides, so I encourage everyone to take a look at his presentation (link provided above).</p>
<h3>The Modular Java Platform: Q&amp;A</h3>
<div id="attachment_15" class="wp-caption aligncenter" style="width: 460px"><img class="size-full wp-image-15" title="round table" src="http://sellmic.com/blog/wp-content/uploads/2007/01/jury_duty.jpg" alt="Jury" width="450" height="161" /><p class="wp-caption-text">There were rumors in the meeting that the clown is a secret member of the Java Posse</p></div>
<p>Wednesday night, I attended a BOF like meeting hosted by Mark and Alex setup in order for the community to openly ask and voice any concerns over the work presented by them on modular Java. The setup was sort of a round table configuration (without the round table) in a very informal setting (btw it was hard for participants in the back to listen well, hopefully microphones are used next time). The first question was kind of funny, somebody asked Alex what a "<em><a href="http://bracha.org/Site/Theology.html">Computational Theologist</a></em>" does (the title makes it sound like the equivalent of a Thomas Aquinas for the nerd world).</p>
<p>After that, it seemed some people were very concerned about how to deploy modules, patch jars and other deployment issues. My impression was that a lot of people had a problem with the native installation part of the proposal. Mark answered that Java developers have gotten used to being in our own little jar world, separate from the OS integration issues of module and library management and that it was time for Java to integrate more with these systems. He has a point, do we really have to deploy log4j jars with all our products over and over instead of simply having a log4j installed in the system that all modules can refer to?</p>
<p>However, installation with native package systems is a big change. And it is also unclear what that is going to look like in Windows. It seemed like the Windows part of the equation has not been finalized, would Java 7 include some type of Java specific module registry or would it leverage something like .NET's <a href="http://en.wikipedia.org/wiki/Global_Assembly_Cache">Global Assembly Cache</a>?</p>
<p>Somebody bought up the point that this new system was imposing more work on open source projects. That is, today you want to release your library as a jar, you know it's going to work everywhere. With Jigsaw, projects may have to deliver a large set of native module packages depending on all the platforms they want to deploy to. Many suggested to Mark and Alex that a cross platform package format was needed, but Mark acknowledged that Sun is not really working on that and they're just worrying mainly about specifying the module file structure and leaving the rest to the native package systems.</p>
<p>I noticed a few members from the OSGi community in attendance, I recognized <a href="http://www.aqute.biz/Main/HomePage">Peter Kriens</a> (member of the OSGi Alliance), <a href="http://www.osgicongress.com/speakers_main.asp#33">Richard S. Hall</a> (From Apache Felix, works for Sun in the Glassfish team) and <a href="http://blog.bjhargrave.com/">BJ Hargrave</a> (CTO of the OSGi Alliance, committer on Eclipse Equinox and IBM employee). Peter and Richard are both members of the expert group for JSR 294, so I was a bit surprised they weren't at all in "harmony" with Mark and Alex and the work they've done with Jigsaw. See, last time I saw discussions on this topic, <a href="http://jcp.org/en/jsr/detail?id=277">JSR 277</a> was still active (it is on hold for now) and I was under the impression that Sun and OSGi had reached some type of "gentleman's agreement". That doesn't seem to be the case at all.</p>
<p>OSGi is a very mature technology and has more features than Jigsaw. However OSGi doesn't address the issue of native package installation, and you could argue that it would not be suitable to solve the issue of modularizing the JDK itself. I think on that last point, many people don't mind Jigsaw even on the OSGi side, the arguments come when you say Jigsaw could be used as an application level module system. Additionally OSGi still has some key features that are missing in Jigsaw; it allows more dynamic loading of modules (useful for plugins) and is backwards compatible (Jigsaw will only be supported from Java 7 and up).</p>
<p>Having said that, one thing I like more about Jigsaw is how it defines dependencies is the <strong><em>module-info.java</em></strong> file. It is a much better syntax than the error prone use of manifest files used in OSGi, where an extra space can break the whole thing for you. Adding keywords for module accessibility is also a very nice thing, and it seems the goal is to also let a modular system like OSGi take advantage of these features. Now how can these both systems inter-operate between each other in a single VM? I have no idea how that works ... yet.</p>
<p>In the end, the Q&amp;A showed that there is a lot of controversy and confusion over this new feature. There was also a noticeable lack of questions during the meeting, with a few of the same people asking all the questions. I got the impression that the need and functionality of a module system in Java is not generally fully understood, so to me that means a lot more work needs to be done to explain just what is going on and why there is so much effort going into this area.</p>
<p>Some key questions I'd like to see clarified:</p>
<ul>
<li>A more technical and detailed explanation of why Jigsaw was chosen over OSGi.</li>
<li>Will the JDK provide tools for wrapping modules in native packages?</li>
<li>Is a cross platform package system completely out of the question?</li>
<li>How would multiple modules systems work together in the same VM/application instance?</li>
<li>What happens when an applet or javafx application requires core JDK modules that are not present in the current installation?</li>
<li>Native library module integration issues (I sort of asked this in the Q&amp;A). Where are native packages placed, and what happens when multiple modules include the same native libraries (say 2 modules have the same DLL embedded in them)?</li>
</ul>
<h3>This doesn't affect me, why should I care?</h3>
<p>These changes will affect everybody, at the very least under the hood your core Java packages will be loaded in a more modularized fashion. For people who would like to run Java in other devices, you will notice that you have better ways to split up your Java distribution to only the parts that you need.</p>
<p>However, if you are interested in scaling your code the right way and modularizing it, you should start becoming familiar with what is going on in this space. For your applications, you'll still have the choice of using existing modular systems like OSGi or using the new facilities provided by Java 7. In the future, we should expect more details to come out as to how you can combine both (Jigsaw and OSGi). Others might prefer not to depend on an external Java project like OSGi and leverage the core support that will be provided for modules.</p>
<p>On the other hand, some people criticize that his is a repeat of the <em>java.util.logging</em> fiasco and say they can mostly ignore these changes. The jury is still out, but this is a very fundamental change in the language and platform and a very different scenario than choosing what logging package to include in the core JDK.</p>
<p>Oh and you might soon see new annoying interview or exam code questions trying to trip you up with gems like this one (from Alex's slides and <a href="http://blogs.sun.com/abuckley/en_US/entry/a_wrinkle_with_module">this blog entry</a>):</p>
<pre name="code" class="java">package module;
// BTW you should NEVER write code like this!!!
module class module {
        module module module = new
            module();
        module module() {}
}</pre>
<p>Anyways, sorry for the longish blog post but hopefully this sheds some light into some of the discussions about this topic that took place at JavaOne. If you are interested in getting more in depth details about this topic, please take a look at some of the following links;</p>
<ul> <a href="http://blogs.sun.com/theplanetarium/entry/project_jigsaw_modularizing_jdk_7">Java SE: Project Jigsaw: Modularizing JDK 7</a><br />
<a href="http://blogs.sun.com/mr/entry/jigsaw">Project Jigsaw</a> (Mark's blog)<br />
<a href="http://blogs.sun.com/mr/entry/modular_java_platform">The Modular Java Platform</a> (Mark's blog)<br />
<a href="http://blogs.sun.com/mr/entry/massive_monolithic_jdk">The massive, monolithic JDK</a> (Mark's blog)<br />
<a href="http://blogs.sun.com/mr/entry/packaging_java_code">Packaging Java code</a> (Mark's blog)<br />
<a href="http://openjdk.java.net/projects/jigsaw/doc/language.html">Project Jigsaw: Language changes for Modules</a><br />
<a href="http://www.osgi.org/blog/2008/12/project-jigsaw.html">Project Jigsaw</a> (Peter Kriens, his version of the "saga of Java modularity)<br />
<a href="http://www.osgi.org/blog/2008_12_01_archive.html">Project Jigsaw #2</a> (Peter Kriens, some criticisms of the proposed system)<br />
<a href="http://www.osgi.org/blog/2009/03/project-jigsaw-3.html">Project Jigsaw #3</a> (Peter Kriens, Jigsaw != JSR 294)<br />
<a href="http://www.infoq.com/news/2008/12/jigsaw-jsr277-dead">Jigsaw - the death knell of JSR277?</a><br />
<a href="http://atsatt.blogspot.com/2009/04/jigsaw-vs-osgi.html">Jigsaw vs OSGi?</a><br />
<a href="http://blogs.sun.com/abuckley/en_US/entry/a_wrinkle_with_module">A wrinkle with 'module'</a> (Alex's blog)<br />
<a href="http://blogs.sun.com/abuckley/resource/Devoxx2008-ModularityInJava.pdf">Modularity in Java</a> (Alex's presentation at DEVOXX 2008; covers module friendship, "virtual modules", multi-module packages, type observability and other topics not covered in the JavaOne slides I linked to in this article)</ul>
<p><strong>Update</strong>. Some additional links that have come to my attention after publishing this blog post;</p>
<ul>
<a href="http://robilad.livejournal.com/51325.html">Jigsaw Feedback Roundup</a> (Dalibor Topic)<br />
<a href="http://javaposse.com/index.php?post_id=492239">Java Posse #259 - Jigsaw and JSR 294 Interview</a> (Java Posse podcast interview with Mark Reinhold and Alex Buckley)
</ul>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/' addthis:title='Classpath hell just froze over ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://sellmic.com/blog/2009/06/11/classpath-hell-just-froze-over/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Live blogging from CommunityOne</title>
		<link>http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/</link>
		<comments>http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 17:04:41 +0000</pubDate>
		<dc:creator>Augusto</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[communityone]]></category>

		<guid isPermaLink="false">http://sellmic.com/blog/?p=229</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/' addthis:title='Live blogging from CommunityOne' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div>JavaOne officially starts tomorrow but today Sun has kicked off CommunityOne. Which is a more open source focused and free conference that precedes the bigger event. The main theme this year is cloud computing. The presentation today has been about showing several vendor solutions in the areas of virtualization and large scale application deployment that [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/' addthis:title='Live blogging from CommunityOne ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/' addthis:title='Live blogging from CommunityOne' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div><p><img class="aligncenter size-full wp-image-234" title="communityone" src="http://sellmic.com/blog/wp-content/uploads/2009/06/communityone.jpg" alt="communityone" width="450" height="315" /></p>
<p>JavaOne officially starts tomorrow but today Sun has kicked off CommunityOne. Which is a more open source focused and free conference that precedes the bigger event.</p>
<p>The main theme this year is cloud computing. The presentation today has been about showing several vendor solutions in the areas of virtualization and large scale application deployment that is very easy to use (and graphical). To be completely honest, I think &#8220;cloud computing&#8221; is a big buzzword approaching marketroid levels, but there is some interesting technology here. I&#8217;ll be attending a few cloud computing sessions to see if I become one of the <strong>converted</strong>.</p>
<p><img class="aligncenter size-full wp-image-230" title="communityone_cloud" src="http://sellmic.com/blog/wp-content/uploads/2009/06/communityone_cloud.jpg" alt="communityone_cloud" width="450" height="269" /></p>
<p>Currently, we&#8217;re listening to some of the folks from OpenSolaris and JavaFX in a setup that seems like a nerd version of David Letterman from an alternate reality.</p>
<p>BTW we got a small announcement that JavaFX is now officially released for OpenSolaris. Although I&#8217;m not sure there&#8217;s a large community of OpenSolaris users looking forward to that <img src='http://sellmic.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/' addthis:title='Live blogging from CommunityOne ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://sellmic.com/blog/2009/06/01/live-blogging-from-communityone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My JavaFX presentation at PanamaJUG 2007 (JavaFX en Español)</title>
		<link>http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/</link>
		<comments>http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/#comments</comments>
		<pubDate>Sun, 18 May 2008 19:12:30 +0000</pubDate>
		<dc:creator>Augusto</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Travel]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/' addthis:title='My JavaFX presentation at PanamaJUG 2007 (JavaFX en Español)' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div>Last December I did a presentation about JavaFX in Spanish for the Panama Java User&#8217;s Group (JUG). This event took place in the city of Chitre, and was a lot of fun to participate in, specially since it gave me a chance to visit my native country. The presentation aimed to serve as an introduction [...]<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/' addthis:title='My JavaFX presentation at PanamaJUG 2007 (JavaFX en Español) ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/' addthis:title='My JavaFX presentation at PanamaJUG 2007 (JavaFX en Español)' ><a class="addthis_button_facebook_like"></a><a class="addthis_button_tweet"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_compact"></a></div><p><center><iframe src="http://docs.google.com/EmbedSlideshow?docid=avn83j2j7zf_10dzgx4ngh" frameborder="0" height="342" width="410"></iframe></center>Last December I did a presentation about JavaFX in Spanish for the Panama Java User&#8217;s Group (JUG). This event took place in the city of Chitre, and was a lot of fun to participate in, specially since it gave me a chance to visit my native country. The presentation aimed to serve as an introduction to JavaFX, providing an overview of the main features of the language. I showed some simple demos from Sun, and a few I created myself. At the end, we went over my <a href="http://sellmic.com/blog/2007/05/22/javafx-clock-update-now-with-transparency/">JavaFX clock</a> implementation and discussed a bit what place JFX occupies in the RIA technology space. The slides are featured at the top of this post, and are in Spanish of course.  Thanks to <a href="http://avbravo.blogspot.com/">Aristides Villareal</a>, and the members of the Panama JUG for inviting me to this wonderful event! I was lucky enough to bring along one of my daughters, Sofia, and she enjoyed the trip very much.</p>
<p>I have to say, the most difficult part of preparing this presentation was trying to figure out the Spanish version of common programming words and concepts. Part of the problem is that when I was learning how to program in Panama (when I was around 10-12 years old) all of my resources; magazines, books, etc where all in English. So I never knew that array is &#8220;arreglo&#8221;, that a developer is called a &#8220;desarrollador&#8221;, or what the corresponding word for loop is. It would be really nice if there was some type of resource out there with a table with all these terms, and maybe other languages. One challenge is that it seems not all of these words are &#8220;settled&#8221;. I noticed some people were still pretty comfortable with the English versions, while others used the Spanish ones exclusively. Also, there are a lot of emerging technologies and concepts in Computer Science which I think still don&#8217;t have Spanish translations. Pretty much a more difficult challenge than I expected.</p>
<p><img src="http://sellmic.com/blog/wp-content/uploads/2008/05/javax-panama-jug.jpg" alt="javax-panama-jug.jpg" /></p>
<p>One more thing, JavaFX has changed a lot in the last year. When I did this presentation, I didn&#8217;t cover how much effort has gone into optimizing this technology or the new changes to the animation API (like the deprecated dur keyword). There is a preview JFX SDK coming out next month, and you can sign up for it at<a href="http://javafx.com"> javafx.com</a>. I didn&#8217;t attend JavaOne this year, so I don&#8217;t know all the details, but I&#8217;m hoping the SDK comes with some of the tooling that Sun has promised. Designer level tools are key to this technology&#8217;s success. I hope to make a blog post with a quick review of the SDK once it comes out.</p>
<div class="addthis_toolbox addthis_default_style addthis_32x32_style" addthis:url='http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/' addthis:title='My JavaFX presentation at PanamaJUG 2007 (JavaFX en Español) ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://sellmic.com/blog/2008/05/18/my-javafx-presentation-at-panamajug-2007-javafx-en-espanol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

