<?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>Blog4Java &#187; Concurrency</title>
	<atom:link href="http://malsolo.com/blog4java/?feed=rss2&#038;tag=concurrency" rel="self" type="application/rss+xml" />
	<link>http://malsolo.com/blog4java</link>
	<description>A personal and Java blog, likely only for me</description>
	<lastBuildDate>Tue, 31 Mar 2015 15:52:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1.1</generator>
	<item>
		<title>Improving Java EE skills (including Spring)</title>
		<link>http://malsolo.com/blog4java/?p=79</link>
		<comments>http://malsolo.com/blog4java/?p=79#comments</comments>
		<pubDate>Fri, 18 Jul 2014 08:28:22 +0000</pubDate>
		<dc:creator><![CDATA[Javier (@jbbarquero)]]></dc:creator>
		
		<guid isPermaLink="false">http://malsolo.com/blog4java/?p=79</guid>
		<description><![CDATA[A friend of mine has requested me some help for improving his skills in Java EE and Spring Framework. An exciting question, indeed. The general context He&#8217;s working for a company since 2008. To work for a company for a &#8230; <a href="http://malsolo.com/blog4java/?p=79">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A friend of mine has requested me some help for improving his skills in Java EE and Spring Framework.</p>
<p>An exciting question, indeed.</p>
<h4>The general context</h4>
<p>He&#8217;s working for a company since 2008. To work for a company for a long time has a lot of pros, but a couple of drawbacks, being one of them a little bit worrying: the chance of obsolescence.</p>
<p>If you&#8217;re using the same environment along the years, let&#8217;s say <a href="http://www-01.ibm.com/software/websphere/solutions/" title="IBM WebSphere" target="_blank">IBM products</a>, you&#8217;ll loose the chance to discover other approaches, for instance <a href="http://www.oracle.com/us/products/middleware/cloud-app-foundation/weblogic/suite/overview/index.html" title="Oracle WebLogic" target="_blank">Oracle solutions</a>, or even better, <a href="http://projects.apache.org/" title="The Apache Software Foundation Projects" target="_blank">open source projects</a>.</p>
<p>Even worst, if the company are not willing to upgrade their products (that is very reasonable if there are budget concerns) or their libraries (that is really unwise, or the direct consequence that you don&#8217;t have a good testing process) suddenly you find yourself that you&#8217;re out of the market.</p>
<p>This is not really a problem as long as your current technology is the best technology for your needs, but sooner or later you have to face to the <a href="http://en.wikipedia.org/wiki/Technical_debt" title="Technical debt from Wikipedia" target="_blank">technical debt</a> (a really <a href="http://martinfowler.com/bliki/TechnicalDebt.html" title="Martin Fowler's TechnicalDebt" target="_blank">interesting topic</a> that <a href="http://blog.codinghorror.com/paying-down-your-technical-debt/" title="Paying Down Your Technical Debt" target="_blank">you should care about</a>). This day will happen when you&#8217;re spending more time in fixing issues than in adding new features to your software.</p>
<p>The problem continues if you try to reinventing the wheel or if you don&#8217;t realize that the plane is already invented. It&#8217;s 21st century, you can fly with the appropriate machine.</p>
<h4>The particular concern</h4>
<p>As I said at the beginning of this entry, he is a <a href="http://www.oracle.com/technetwork/java/javaee/overview/index.html" title="Java EE Overview" target="_blank">Java EE</a> developer that uses <a href="https://spring.io/" title="Spring" target="_blank">Spring Framework</a> in his daily work. But he still has to program for <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21570083" title="End of Support for WebSphere Application Server 6.1" target="_blank">WebSphere Application Server 6.1</a> (a.k.a. WAS 6.1, that is <a href="http://en.wikipedia.org/wiki/Java_EE_version_history#J2EE_1.4_.28November_11.2C_2003.29" title="Wikipedia J2EE 1.4" target="_blank">Java EE 1.4</a> compliance using <a href="http://www.oracle.com/technetwork/java/eol-135779.html" title="Oracle Java SE Support Roadmap" target="_blank">Java 5 SE</a>) using <a href="http://docs.spring.io/spring/docs/3.0.x/spring-framework-reference/html/" title="Spring Framework 3.0 Reference Documentation" target="_blank">Spring framework 3</a> (<a href="https://spring.io/blog/2007/11/19/spring-framework-2-5-released" title="Spring Framework 2.5 released" target="_blank">2.5</a> for some projects)</p>
<p>At the time of this writing, <a href="http://www.oracle.com/us/corporate/press/1957557" title="Oracle Press Release Java EE 7" target="_blank">Java EE 7</a> is already released and the current version of <a href="http://projects.spring.io/spring-framework/" title="Spring Framework" target="_blank">Spring Framework is 4.0.6</a>. Not mentioning that Java 8<a href="http://www.oracle.com/us/corporate/press/2172618" title="Oracle Announces Java 8" target="_blank"></a> is now with us.</p>
<p>Thus, he wants to get up to date for improving the way he writes code that will be profitable for the company he works for.</p>
<p>I appreciate his request, because I&#8217;ll have to review what I really know.</p>
<p>Well. Enough introduction. In coming posts I will write about my particular thoughts of what you can do to know Java a little better.</p>
<p>Next, a summary of the topics that I want to talk about:</p>
<h4>Suggested topics</h4>
<ul>
<li><a href="http://www.oracle.com/technetwork/java/javase/overview/index.html" title="Java SE at a Glance" target="_blank">Java SE</a></li>
<p>The Java EE platform is built on top of the Java SE platform. The Java EE platform provides a particular API for server programming. So,it&#8217;s very reasonable to have a good knowledge of Java SE.</p>
<p>In particular, I assume that you have basic knowledge of Java.</p>
<p>But if you want to improve, you need to know the new features that have been published during the last years:</p>
<ul>
<li><a href="http://docs.oracle.com/javase/1.5.0/docs/relnotes/features.html#lang" title="New Features and Enhancements J2SE 5.0" target="_blank">Java 5</a></li>
<p><a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/generics.html" title="Generics" target="_blank">Generics</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html" title="The For-Each Loop" target="_blank">enhanced loops</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/autoboxing.html" title="Autoboxing" target="_blank">autoboxing</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/enums.html" title="Enums" target="_blank">enums</a> (I love them), <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/varargs.html" title="Varargs" target="_blank">varargs</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/static-import.html" title="Static Import" target="_blank">static import</a>, and maybe the most important: <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/annotations.html" title="Annotations" target="_blank">annotations</a> (they change our life as Java developers)</p>
<li><a href="http://www.oracle.com/technetwork/java/javase/features-141434.html" title="Highlights of Technology Changes in Java SE 6" target="_blank">Java 6</a></li>
<p><a href="http://www.onjava.com/pub/a/onjava/2006/08/02/jjdbc-4-enhancements-in-java-se-6.html" title="JDBC 4.0 Enhancements in Java SE 6" target="_blank">JDBC 4.0</a>, Support for the Web Services stack and XML processing, and <a href="http://www.oracle.com/technetwork/articles/javase/beta2-135158.html" title="What's New in Java SE 6" target="_blank">many more</a>. </p>
<li><a href="http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html" title="Java SE 7 Features and Enhancements" target="_blank">Java 7</a></li>
<p>A quite <a href="http://radar.oreilly.com/2011/09/java7-features.html" title="A look at Java 7's new features" target="_blank">handy features for developing</a> like <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/strings-switch.html" title="Strings in switch Statements" target="_blank">Strings in switch statements</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/binary-literals.html" title="Binary Literals" target="_blank">Binary integral literals</a> and <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html" title="Underscores in Numeric Literals" target="_blank">underscores in numeric literals</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html" title="Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking" target="_blank">Multi-catch and more precise rethrow</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/type-inference-generic-instance-creation.html" title="Type Inference for Generic Instance Creation" target="_blank">diamond operator</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/try-with-resources.html" title="The try-with-resources Statement" target="_blank">try-with-resources</a>, <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/language/non-reifiable-varargs.html" title="Improved Compiler Warnings and Errors When Using Non-Reifiable Formal Parameters with Varargs Methods" target="_blank">Simplified varargs method invocation</a>.</p>
</ul>
<p>As Java 8 has been released very recently, you can skip it for a little while.</p>
<li><a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/" title="Java Concurrency" target="_blank">Java Concurrency</a></li>
<p>Why a specific section for Java SE Concurrency?</p>
<p>Because in Java SE 5 everything changed. Concurrency in Java was improved in a way that provides a more natural approach to multi-threading (I had great joy with two of the enhancement of Java 5: <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/generics.html" title="Java Generics" target="_blank">Generics </a>and <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/Callable.html" title="Java Callable" target="_blank">Callable</a>) and at the same time it avoids the long-term errors that the concurrency library had: the method <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#stop--" title="Java Thread stop" target="_blank">Thread.stop()</a> (actually, it already exists, and <a href="http://docs.oracle.com/javase/8/docs/technotes/guides/concurrency/threadPrimitiveDeprecation.html" title="Why is Thread.stop deprecated?" target="_blank">I don&#8217;t know why</a>)</p>
<p>Not only you need to try not using Thread.start() anymore, try ExceutorService instead, you also need to know about Future and the new way to synchronize threads for understanding new features for concurrency of Java EE 7.</p>
<p>Besides, it&#8217;s really an improvement to know about <a href="http://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html" title="Executors" target="_blank">Executor Framework</a> in Java.</p>
<p>There are a couple of good Java Concurrency tutorials:</p>
<ul>
<li><a href="http://www.vogella.com/tutorials/JavaConcurrency/article.html" title="Vogella's concurrency" target="_blank">Vogella&#8217;s Java concurrency (multi-threading) &#8211; Tutorial</a></li>
<li><a href="http://tutorials.jenkov.com/java-concurrency/index.html" title="Jenkov's Concurrency" target="_blank">Jenkov&#8217;s Java Concurrency / Multithreading Tutorial</a> and <a href="http://tutorials.jenkov.com/java-util-concurrent/index.html" title="Jenkov's concurrency utilities" target="_blank">Java Concurrency Utilities</a></li>
</ul>
<li><a href="http://www.oracle.com/technetwork/java/javaee/overview/index.html" title="Java EE at a Glance" target="_blank">Java EE 7</a></li>
<p>In spite of there are only a few <a href="http://www.oracle.com/technetwork/java/javaee/overview/compatibility-jsp-136984.html" title="Java EE Compatibility" target="_blank">Java EE 7 compatible servers</a>, it&#8217;s time to know about the <a href="http://www.infoworld.com/slideshow/105268/11-hot-improvements-java-ee-7-220465" title="11 hot improvements to Java EE 7" target="_blank">exciting new features</a> that will allow you to create better and faster applications:</p>
<ul>
<li>HTML5 (<a href="http://docs.oracle.com/javaee/7/tutorial/doc/websocket.htm#GKJIQ5" title="Java API for WebSocket" target="_blank">WebSockets</a> and <a href="http://docs.oracle.com/javaee/7/tutorial/doc/jsonp.htm#GLRBB" title="JSON Processing" target="_blank">JSON</a>)</li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/partmessaging.htm#GFIRP3" title="Messaging" target="_blank">Simplified JMS 2.0 API</a></li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/batch-processing.htm#GKJIQ6" title="Batch Processing" target="_blank">Batch applications</a></li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/concurrency-utilities.htm" title="Concurrency Utilities for Java EE" target="_blank">Concurrency utilities</a> (at last <a href="https://jcp.org/en/jsr/detail?id=236" title="JSR 236: Concurrency Utilities for Java EE" target="_blank">JSR 236</a> is finished)</li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/partcdi.htm#GJBNR" title="Contexts and Dependency Injection for Java EE" target="_blank">Context Dependency Injection</a> (CDI. Yeah, introduced in Java EE 6, it has been enhanced to compete with Spring&#8217;s @Autowired)</li>
<li>Java API for RESTful Web Services (JAX-RS) 2.0 (<a href="http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs.htm#GIEPU" title="RESTful" target="_blank">webservices</a>, <a href="http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-client.htm#BABEIGIH" title="Accesing REST" target="_blank">clients</a> and <a href="http://docs.oracle.com/javaee/7/tutorial/doc/jaxrs-advanced.htm#GJJXE" title="JAX-RS: Advanced Topics and an Example" target="_blank">more</a>)</li>
<li><a href="http://docs.oracle.com/javaee/7/tutorial/doc/servlets.htm#BNAFD" title="Java Servlet TEchnology" target="_blank">Servlet 3.1</a></li>
</ul>
<li><a href="https://spring.io/projects" title="Spring projects" target="_blank">Spring Projects</a></li>
<p>I want to create particular blog entries for each Spring project that I&#8217;ve worked with, but in the meantime, the best way to getting started would be to take a look to the <a href="https://spring.io/guides" title="Spring guides" target="_blank">guides</a> that they provide.</p>
<li>Other technologies good to know</li>
<p>Since you&#8217;re using Java for writing programs to build solutions for business, it&#8217;s good to know the new environments that provides modern approaches for the current challenges.</p>
<p>You have to take a look to <a href="http://en.wikipedia.org/wiki/NoSQL" title="NoSQL from Wikipedia" target="_blank">NoSQL</a>, being <a href="http://www.mongodb.org/" title="mongoDB" target="_blank">MongoDB</a> the most popular, with good <a href="http://docs.mongodb.org/manual/" title="The MongoDB 2.6 Manual" target="_blank">documentation</a>, including <a href="http://docs.mongodb.org/ecosystem/drivers/java/" title="Java MongoDB Driver" target="_blank">programming with Java</a>.</p>
<p>The next step should be <a href="http://en.wikipedia.org/wiki/Big_data" title="Big data from Wikipedia" target="_blank">Big Data</a>. <a href="http://hadoop.apache.org/" title="Apache Hadoop" target="_blank">Hadoop</a> is the project that you have to pay attention for, but it&#8217;s so big, with several related projects, and so complex, that I still haven&#8217;t found a good introductory tutorial.</p>
<p>Finally, <a href="http://en.wikipedia.org/wiki/Asynchronous_I/O" title="Asynchronous I/O from Wikipedia" target="_blank">Asynchronous I/O</a>, that is the new solution for a problem that has been created by the new economy based on the internet of the things, that is, the need of handle scaling transactions from hundreds, thousands, even millions of users and the requirement of high-performance, high-speed for these operations.</p>
<p>There are several new frameworks that are worth it: <a href="http://akka.io/" title="Akka" target="_blank">Akka</a>, <a href="http://malsolo.com/blog4java/?p=35" title="Getting started with Vert.x" target="_blank">Vert.x</a>, <a href="https://github.com/reactor/reactor" title="Reactor" target="_blank">Reactor</a> (<a href="https://spring.io/blog/2013/05/13/reactor-a-foundation-for-asynchronous-applications-on-the-jvm" title="Reactor" target="_blank">a foundational framework</a> for <a href="https://spring.io/blog/2013/07/18/reactor-1-0-0-m1-a-foundation-for-asynchronous-fast-data-applications-on-the-jvm" title="Reactor 1.0.0.M1" target="_blank">asynchronous applications on the JVM</a>, <a href="https://spring.io/blog/2014/05/06/reactor-1-1-0-release-now-available" title="Reactor 1.1.0" target="_blank">by Spring</a>, but it&#8217;s not part of the portfolio) and <a href="http://nodejs.org/" title="Node.js" target="_blank">Node.js</a> (yes, it&#8217;s JavaScript)</p>
</ul>
<p>That&#8217;s all for now. I hope my colleague finds this entry interesting and I wish it is the first of a series of articles.</p>
<p>Let&#8217;s see.</p>
]]></content:encoded>
			<wfw:commentRss>http://malsolo.com/blog4java/?feed=rss2&#038;p=79</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
