<?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>nosoftskills.com &#187; Ivko&#8217;s choice of the week</title>
	<atom:link href="http://nosoftskills.com/category/java/ivkos-choice-of-the-week/feed/" rel="self" type="application/rss+xml" />
	<link>http://nosoftskills.com</link>
	<description></description>
	<lastBuildDate>Sun, 09 Dec 2012 12:09:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Choice of the week &#8211; 16/2010</title>
		<link>http://nosoftskills.com/2010/04/choice-of-the-week-162010/</link>
		<comments>http://nosoftskills.com/2010/04/choice-of-the-week-162010/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 19:56:15 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=82</guid>
		<description><![CDATA[by Ivan St. Ivanov Considering data stores This article is not from this week, but anyway, it is very interesting and profound, so I cannot help sharing it with you. What is a data store? Well, this is a repository where you can store data. Author&#8217;s idea is to provide a quick overview and benchmark [...]]]></description>
				<content:encoded><![CDATA[<h4>by Ivan St. Ivanov</h4>
<h3><a href="http://www.enigmastation.com/?page_id=425" target="_blank">Considering data stores</a></h3>
<p>This article is not from this week, but anyway, it is very interesting and profound, so I cannot help sharing it with you.</p>
<p>What is a data store? Well, this is a repository where you can store data. Author&#8217;s idea is to provide a quick overview and benchmark results of a wide range of data stores.</p>
<p>There are certainly several types of data stores &#8211; relational databases, object databases, document oriented stores, etc. For each of these types there are different kinds of libraries and even technologies that help the developer work with the data storage. Each of the data stores and the concrete implementations has its strengths and weaknesses. In the beginning the author tries to stress that there is no silver bullet that solves the data storage issues. However, most people (99,99999% according to him) go for the relational database solution and most of those (there is no percentage mentioned) use JPA as the layer between JDBC and the application code. The author calls this no-thought solution SOD &#8211; same old data store.</p>
<p>I must admit that I am in the SOD camp &#8211; I don&#8217;t usually think much when I have to develop a simple application. I go directly to relational DB + JPA. However, at a bigger project where I participated, we had to judge between several persistence representations and technologies, so I had the opportunity to get acquainted with some of them (even a <a href="http://dotev.blogspot.com/" target="_blank">colleague of mine</a> keeps insisting that JCR is the best solution, even though we chose JAXB and XML <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ).</p>
<p>Anyway, the bottom line is that it is good that people like Joe write such reviews so that the next time we&#8217;ll take a well-thought decision and not go directly to the SOD.</p>
<h3><a href="http://www.jroller.com/melix/entry/coding_a_groovy_closure_in" target="_blank">Groovy closure in pure Java</a></h3>
<p>&#8216;Closures in Java&#8217; is a long discussed topic in the community. And it seems that we are going to have them in JDK 7.</p>
<p>But first, what is a closure? Well, this is can be a very broad and complex area, but the easiest answer is &#8211; a function pointer. Hmm, it does not seem quite clear, right? OK, imagine that you can define a block of code and you can pass that as a parameter to normal functions. For example you can define a generic iterate() method over a collection, which receives the <strong>algorithm</strong> that handles the collection data.</p>
<p>Anyway, we should not wait for JDK 7 to come to start using closures. Most of the dynamically typed languages have them and some of them are built on top of the JVM, which means that they &#8220;compile&#8221; to Java byte code.</p>
<p>The article described hereby is an example of how you can implement a Groovy method that takes a closure parameter and then create and pass this parameter from withing pure Java code. Short but useful hint! <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a href="http://java.dzone.com/articles/jdbc-faq-getting-started" target="_blank">The ABC of JDBC, part 1</a></h3>
<p>JDBC was discussed in an earlier article of this blog. So if you liked it, but you are still not very familiar with it, then DZone&#8217;s series is just for you.</p>
<p>In the first interview-like installment Daniel Rubio explains the very basic terms of JDBC: how it works, what is a connection and how do you create it, what is a statement, how are connections pooled, what is a DB driver, etc.</p>
<h3><a href="http://www.ibm.com/developerworks/java/library/j-5things2.html" target="_blank">5 things you didn&#8217;t know about&#8230; the Java Collections API, part 1</a></h3>
<p>IBM developerWorks continues Ted Neward&#8217;s series <a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=5+things+you+did" target="_blank">&#8220;5 things you didn&#8217;t know about&#8230;&#8221;</a>. Now it is time for the Java Collections API. As this is a very vast topic, there will be several parts devoted to it.</p>
<p>In this first part the author starts with the most obvious things &#8211; how you can use the API for common stuff: converting an array into a collection, iteration, the new for-each loop and its usage with collections, new and handy collection algorithms and extending a collection.</p>
<p>I personally thought that using the plain old array is better in terms of optimization. Well, not exactly. Think about all the tedious code that you have to write for a single operation with the array. For example a simple dumping to the console requires at least several lines of code. Not to mention extending it with one or several elements. Well, this is handled by the collections API for you. Not only that, but the API designers have overcome all the traps that you can fall into if you decide to work with the array by yourself &#8211; concurrency for example.</p>
<p>So, my advice is: use collections as much as possible. It&#8217;s easy, it&#8217;s fast and your code will be clean and easy to understand and maintain.</p>
<h3><a href="http://www.informit.com/guides/content.aspx?g=java&amp;seqNum=562" target="_blank">JavaScript in Java with Mozilla Rhino</a></h3>
<p>Last but not least, Steven Haines, the editor in chief of the InformIT Java guide created a quick series this week on running JavaScript code inside Java programs using the Rhino library coming from Mozilla.</p>
<p>The usecase presented here is that a certain web application needed same validation to be run on the server, as well as on the client side. The easiest solution would be to develop the validation logic twice &#8211; the first time in a language suitable for the browser (e.g. JavaScript) and the second time in Java &#8211; our server side language of choice. After a while you can realize that this is not a good idea: developing something twice is one of the worst practices, which we always try to avoid (though I must admit I&#8217;m still doing it <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> ).</p>
<p>So the solution is simple: write the validation code just once and call this same code on both locations. It&#8217;s easy to run JavaScript on the client side &#8211; all the modern browsers understand it. But how do you do it in Java? Well, Mozilla Rhine does it all and InformIT knows it all.</p>
<p>Don&#8217;t forget after reading the first part to go on with the next ones by clicking the <em>Next</em> links at the bottom right of the articles. Thus you will find out how you can combine the result of different functions, how you can build a JavaScript entity using <a href="http://www.json.org/" target="_blank">JSON</a> and how you can convert it to a JavaBean with <a href="http://code.google.com/p/google-gson/" target="_blank">GSON</a>, and finally how you can organize your validation code.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/04/choice-of-the-week-162010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>http://nosoftskills.com/2010/04/81/</link>
		<comments>http://nosoftskills.com/2010/04/81/#comments</comments>
		<pubDate>Sun, 18 Apr 2010 20:44:10 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=81</guid>
		<description><![CDATA[by Ivan St. Ivanov More on test coverage Last week we discussed the topic of the missing compiler in dynamic languages (and in particular in JavaScript). If you remember well, according to the author the lack of a compiler can be easily made up by having near to 100% test coverage. This week I read [...]]]></description>
				<content:encoded><![CDATA[<h4>by Ivan St. Ivanov</h4>
<h3>More on test coverage</h3>
<p>Last week we discussed the topic of the missing compiler in dynamic languages (and in particular in JavaScript). If you remember well, according to the author the lack of a compiler can be easily made up by having near to 100% test coverage.</p>
<p>This week I read two blogs circling around the test coverage topic. <a href="http://alexruiz.developerblogs.com/?p=1030" target="_blank">The first one</a> insists that 100% test coverage may sometimes give you false idea about your code quality. The idea is that if you think that with 100% coverage you are done and safe, then you are wrong. You have to surely go to the next level &#8211; manual or automatic integration tests. Such tests that test your code the way that it will be really executed and not the way that you think it will be executed (which you express in the unit tests).</p>
<p><a href="http://www.cacoethes.co.uk/blog/groovyandgrails/243" target="_blank">The next blog post</a> is kind of a sequel (though written by different person) to that from last week on JavaScript. This time it looks from the Groovy language perspective. It actually explains why preventing syntax or type mismatch errors that are usually caught by the compiler in the statically typed languages, does not require writing additional tests. You can see that the mainstream tests that you would write in a compiled language, would do the job of the compiler.</p>
<p>So, do not fear, write test, be cool (or groovy? <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) and don&#8217;t worry about the rest.</p>
<h3><a href="http://www.ibm.com/developerworks/java/library/j-springwebflow.html?ca=drs-" target="_blank">Flow-managed persistence in Spring Web Flow</a></h3>
<p>This is an article for those of you who are aware and use <a href="http://www.springsource.org/webflow" target="_blank">Spring Web Flow</a>. It is a framework that gives you the opportunity to easily build wizard-like web application.</p>
<p>The author of the IBM developerWorks article focuses on the persistence mechanisms in a Web Flow application. Basically during a typical application the user is navigating through several pages and views, each of which presents different data, which needs to be stored somehow during the flow. However usually the user input is not committed in the database on each click of a Next button, but rather at the end, when the whole process is finished.</p>
<p>So the author shows you how you can use different techniques of controlling the transactions in both the atomic and non-atomic web flows (the latter commits a portion of the data on each transition). It was interesting for a person like me (I have a common knowledge on Spring, but nothing on Spring Web Flow). I hope that there are readers with interest and experience in the latter. You will surely appreciate and find the article useful.</p>
<h3><a href="http://hazems.blogetery.com/2010/04/11/understanding-the-jsf-2-0-flash-scope/" target="_blank">Understanding JSF 2.0 Flash scope</a></h3>
<p>This is a very interesting introductory article explaining how to use the so called flash scope in JSF 2.0. The scopes in the Java EE 6 world are coming from the <em>Contexts and dependency injection</em> technology. They are basically concerning how long an object is managed by the container. The most usual scope is the request scope. The problem there is that after the request is over (it usually happens on each redirect to another page), the data submitted at the previous request is lost. However, sometimes you need that data and you don&#8217;t want to use the session for storing the data that has to survive between the different requests. If you just need you data to be alive in the next request, then you put it in the flash scope.</p>
<p>How to do that and how to get it from there? Go on and read the article and you&#8217;ll find out. <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a href="http://www.aviyehuda.com/?p=768" target="_blank">Quick introduction to Hibernate validator</a></h3>
<p>Most the application developed today (no matter whether they do web or desktop apps) ask the user to enter some kind of data. This automatically implies that the user input has to be validated against defined rules (or constraints) like &#8220;not null&#8221;, &#8220;at least 10 characters long&#8221;, &#8220;at most 100 characters long&#8221;, etc. The different [web application] frameworks have provided different approaches for data validation.</p>
<p>Before Hibernate validator was born, all the existing validation libraries were bound to a certain layer. Some of them did the validation in the presentation layer, others in the business layer and even some application rely on the validations done by the database engine.</p>
<p>With <a href="http://www.hibernate.org/subprojects/validator.html" target="_blank">Hibernate validator</a> the developers are free to put the validation code wherever they like. The only thing they need to do before that is to create the metadata (what are the validation constraints) in the domain objects that will be eventually validated. And leave the rest to the framework.</p>
<p>Now, the article presented hereby gives you a quick start to using the Hibernate validator library, which above all appears to be the reference application for the <a href="http://jcp.org/en/jsr/detail?id=303" target="_blank">bean validation specification</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/04/81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 14/2010</title>
		<link>http://nosoftskills.com/2010/04/choice-of-the-week-142010/</link>
		<comments>http://nosoftskills.com/2010/04/choice-of-the-week-142010/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 20:51:24 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=79</guid>
		<description><![CDATA[Five things you didn&#8217;t know about Java Serialization Ted Neward has started a new series of articles on IBM developer works. The series is entitled &#8220;5 things you didn&#8217;t know about&#8230;&#8221; and the first installment is about Java object serialization. Most of the Java developers must be familiar with the topic as even the first [...]]]></description>
				<content:encoded><![CDATA[<h3><a href="http://www.ibm.com/developerworks/java/library/j-5things1/index.html?ca=drs-" target="_blank">Five things you didn&#8217;t know about Java Serialization</a></h3>
<p>Ted Neward has started a new series of articles on <a href="http://www.ibm.com/developerworks/java/" target="_blank">IBM developer works</a>. The series is entitled &#8220;5 things you didn&#8217;t know about&#8230;&#8221; and the first installment is about Java object serialization.</p>
<p>Most of the Java developers must be familiar with the topic as even the first tutorials teach how to serialize an object [graph] to the disk or to the network. At least I knew that in order for my class to be serialized, it had to implement the Serializable marker interface and make sure that all my class&#8217;s fields are <em>serializable</em> as well. Finally I needed to call a special method on the ObjectOutputStream to store the object or to ObjectInputStream to load it back. Later on, I learned why it is so important to have the serial version ID static field.</p>
<p>Well, this is nothing compared to what I found in Ted&#8217;s article. Do read it if you want to broaden your scope and follow the <a href="http://www.ibm.com/developerworks/views/java/libraryview.jsp?search_by=5+things+you+did" target="_blank">series</a> either at developer works or on this blog for the next 5 things that you did not know.</p>
<h3><a href="http://www.ibm.com/developerworks/java/library/j-ce/index.html?ca=drs-" target="_blank">When you can&#8217;t throw an exception</a></h3>
<p>Another article from IBM developer works. This time it comes from Elliot Rusty Harold. It deals with the case when you have to override or implement a method from a superclass or interface that does not throw a checked exception. And for some reason you have an exceptional situation in your implementation.</p>
<p>You can&#8217;t throw the exception, as your code will not even compile &#8211; it is not allowed for the overriding method to throw checked exceptions that are not defined in the superclass. You should not leave the exception unhandled as well &#8211; it is a very bad practice, which may lead to unpredictable behavior. It is not a good idea to throw unchecked exceptions in such situations either.</p>
<p>So what you can do according to the author: either separate the code that throws the exception from the one that naturally belongs to the overriding method, or define your own interface.</p>
<p>This is a very interesting article as it not only gives a tip on how to handle such situations, but also discusses the question about using checked exception. During my life as a Java developer I personally used to be fan of both schools. In the beginning I defined interfaces, which all methods threw a certain checked exception, no matter whether it was needed or not. Then I started hating them and went to throwing unchecked exceptions only when it was absolutely necessary (you don&#8217;t deal with input/output in 100% of your code, do you?). Of course the truth as always is somewhere in between &#8211; use checked exceptions only when something has to be dealt at development time.</p>
<h3>OSGi and web applications</h3>
<p>This week I recommend you two articles on nearly the same topic: how you can use OSGi when you develop web applications. So far at least my idea about OSGi was that it can be used only by some low level server side components. And that the web applications could only be built upon the OSGi infrastructure, but not use it directly. Well, the good news is that the people from Glassfish, Equinox and [hopefully] the other OSGi vendors or adopters are not so narrow-minded as I used to be <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The <a href="http://weblogs.java.net/blog/ss141213/archive/2010/04/08/jax-ws-web-service-osgi-bundle" target="_blank">first article</a> discusses how a Web service built and deployed on Glassfish can call a method, defined and implemented by an OSGi bundle, registered as an OSGi service. As Glassfish is also implemented using OSGi (it is based on <a href="http://felix.apache.org/site/index.html" target="_blank">Apache Felix</a>), it is perfectly fine that your web module&#8217;s MANIFEST.MF file contains the necessary entries so that it imports other bundles. Basically this is all the magic needed by your web service in order to call OSGi services defined in the same container.</p>
<p>The <a href="http://www.peterfriese.de/osgi-servlets-a-happy-marriage/" target="_blank">second article</a> opened my eyes even wider. As I mentioned earlier, my recent opinion was that the existing OSGi implementations only offer some basic functionality to enable the OSGi specification. What I didn&#8217;t know was that Equinox and most probably other OSGi implementations have packed some bundles that start an embedded web server. So if your bundle has a Java Servlet inside and you import the right packages, you will be able to develop a sample web application directly inside Equinox. As this still sounds very awkward to me (sorry again for the narrow-minded-ness <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ), please feel encouraged to comment on this topic.</p>
<h3><a href="http://misko.hevery.com/2010/04/07/move-over-java-i-have-fallen-in-love-with-javascript/" target="_blank">Java script vs Java (again)</a></h3>
<p>One of the people from whom I have learned very much in the area of object oriented design in Java &#8211; Misko Hevery, explains why he has become fan of JavaScript. He starts with the most popular myth from the camp of the statically typed languages fans &#8211; the lack of the compiler in the dynamically typed world makes the latter such. According to the author the fact that you can write unit tests in JavaScript makes up for the missing compiler. If you have close-to-100% code coverage of your JavaScript code, which is run (successfully) on more than regular basis, then you should not worry about syntax or other errors that might appear at runtime, but could be caught by the compiler.</p>
<p>After that, the author starts with the most common advantages of dynamically typed languages &#8211; you write less code to achieve the same obvious things, closures are part of the language, simplicity, duck typing. Finally the author tries to bust another myth &#8211; that writing a program in a dynamic language cannot scale to a big team of developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/04/choice-of-the-week-142010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 13/2010</title>
		<link>http://nosoftskills.com/2010/04/choice-of-the-week-132010/</link>
		<comments>http://nosoftskills.com/2010/04/choice-of-the-week-132010/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 19:36:53 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=76</guid>
		<description><![CDATA[Ivan St. Ivanov This week I am one day late (again). The reason for that is that we are having the Easter holidays. So, Христос Воскресе as we say in my country (which literally means Christ has resurrected! and is a standard greeting during the Easter days in Bulgaria). Today I&#8217;m trying to not only [...]]]></description>
				<content:encoded><![CDATA[<h4>Ivan St. Ivanov</h4>
<p>This week I am one day late (again). The reason for that is that we are having the Easter holidays. So, <em>Христос Воскресе</em> as we say in my country (which literally means <em>Christ has resurrected!</em> and is a standard greeting during the Easter days in Bulgaria).</p>
<p>Today I&#8217;m trying to not only present you the interesting articles from last week, but also give you my personal opinion on the topics that they discuss. I hope you&#8217;ll give yours either in our forum or directly below the article that I comment.</p>
<h3><a href="http://www.developer.com/open/article.php/10930_3873466_2/The-Basics-of-SQL-Joins-in-MySQL.htm" target="_blank">The basics of SQL joins</a></h3>
<p>This is a developer.com article that is for all the developers (no matter Java or not) that have finally hit the database. Databases are the preferred way to store data in next to simple applications. And if you application is even a little bit more complex and you are a good software designer, you will need to put your data in more than one table. Not only that, but some of the queries that you will make will retrieve data from more than one table at a time.</p>
<p>So, this is where the table joins come into play. If you are new to this area, then this is the article for you. I must confess that I don&#8217;t use joins too much in my development. Even before the days of JPA I used complex select statements (from more than one table). If you are like me, then probably the outer and self joins sections will be of interest to you <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a href="http://marxsoftware.blogspot.com/2010/03/sqlphobia-irrational-fear-of-sql.html" target="_blank">SQL phobia &#8211; fear of SQL</a></h3>
<p>While we are still on the SQL wave, here is a very interesting article for other group of people like me &#8211; those who are going to the numerous frameworks like JPA, JDO, Hibernate, etc. that abstract writing SQL. These frameworks give you the opportunities to write XML, customize annotations and do whatever kind of magic to come over the <a href="http://en.wikipedia.org/wiki/Object-relational_impedance_mismatch" target="_blank">impedance mismatch</a> between relational databases and object oriented software. And thus escape from SQL.</p>
<p>The author speculates about the reasons why we started our irrational (according to him) hate to SQL. I agree with him that the hate to SQL is irrational &#8211; people should know SQL no matter of the frameworks that are created now and then. I am great fan of JPA, but I heavily use SQL in my test cases or for debug reasons. As the author mentions &#8211; SQL is not complex at all, so you should not be afraid of it.</p>
<p>The <a href="http://en.wikipedia.org/wiki/NoSQL" target="_blank">NoSQL</a> &#8220;movement&#8221;, which is so popular these days, has nothing to do with SQL as a language, but rather with the relational databases. This is also mentioned by the author.</p>
<p>If you like to read a not so technical, but more philosophic point of view on the topic, then go on reading this blog post.</p>
<h3><a href="http://java.dzone.com/articles/jax-ws-hello-world" target="_blank">JAX-WS hello world</a></h3>
<p>Here is a five minute tutorial on how to create a JAX-WS web service and a client for it. Of course as a five-minuter it is not a sophisticated CRM application for example, but rather a &#8220;Hello world&#8221; one. Anyway, it is a very good one for those of you who want to learn the basic web service interfaces and their usage in the JAX-WS flavor.</p>
<p>By the way, InfoQ, that has a great focus on both flavors &#8211; JAX-WS and JAX-RS, has a short blog on <a href="http://java.dzone.com/articles/jax-ws-hello-world" target="_blank">REST and SOAP: When Should I Use Each (or Both)?</a>.</p>
<h3>Soft skills article of the week</h3>
<p>In <a href="http://www.lifebeyondcode.com/2010/03/29/9-reasons-why-many-smart-people-go-nowhere/" target="_blank">this article</a> you can find 9 reasons why [some of the] smart people are not able to find the greatest place to show their talents. I would encourage you to go and read the article by yourself. And then read the comments. And then possibly write a comment. But please do it only after you read my comment in the next paragraph.</p>
<p>In my opinion the best friend and enemy of a software developer (hopefully a smart one) is the humiliation. If you have it in a reasonable quantity, then it&#8217;s OK. What do I mean by reasonable quantity? Well, for example don&#8217;t expect that after you write your first &#8216;Hello world&#8217; application in a fancy language or framework that your fellow colleagues haven&#8217;t heard about, you are the world&#8217;s expert in this matter. On the other side, don&#8217;t be too humiliated if you want to be successful. Feel free to express your opinion and be sure that by mentioning that it is your personal thought on the matter, you will not make anyone special confront with you. And even if there are people that can tell you that you are stupid, you must be sure that their statement was more stupid than you.</p>
<p>So, try to keep to the humiliation boundary, learn from the other people&#8217;s ideas and mistakes and you&#8217;ll be a smart guy with at least moderate success <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3>April fools&#8217; article of the week</h3>
<p>This week we had the April fools&#8217; day. And the most interesting <a href="https://blogs.apache.org/foundation/entry/the_apache_software_foundation_receives" target="_blank">article</a> was that Apache Software Foundation has sold all its intellectual properties and assets to Oracle for 1.5 billion dollars in cache. Well, I hope this is really an April fools article, but who knows&#8230; <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/04/choice-of-the-week-132010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 12/2010</title>
		<link>http://nosoftskills.com/2010/03/choice-of-the-week-122010/</link>
		<comments>http://nosoftskills.com/2010/03/choice-of-the-week-122010/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 20:28:11 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=74</guid>
		<description><![CDATA[by Ivan St. Ivanov Hello Facelets, goodbye JSP JavaServer Faces (or JSF) 2.0 is the preferred view technology in Java EE 6. Not only it lets you build rich UIs using various technologies (like AJAX for example), but you can also easily build reusable and composite view components. Although the JavaServer Pages (JSP) is still [...]]]></description>
				<content:encoded><![CDATA[<h4>by Ivan St. Ivanov</h4>
<h3><a href="http://www.developer.com/features/article.php/3867851/JSF-20-Views-Hello-Facelets-Goodbye-JSP.htm" target="_blank">Hello Facelets, goodbye JSP</a></h3>
<p>JavaServer Faces (or JSF) 2.0 is the preferred view technology in Java EE 6. Not only it lets you build rich UIs using various technologies (like AJAX for example), but you can also easily build reusable and composite view components. Although the JavaServer Pages (JSP) is still supported by the specification, JSF as of its 2.0 version will officially use the Facelets technology for the view description.</p>
<p>Facelets uses the same known tag libraries (JSTL core, JSTL functions, JSF core and JSF HTML) and on top it adds the JSF facelets library. It mainly contains tags for component definition and composition. Thus you can once create a login form component for example, put it in a JSF file (with extension xhtml) and then embed it in other JSF files and pages.</p>
<p>The above article is another good introduction to the JSF technology and the Facelets. The good news in the JSF area is that the books about version 2.0 are already coming. Ed Burns&#8217;s <a href="http://www.amazon.com/JavaServer-Faces-2-0-Complete-Reference/dp/0071625097/ref=sr_1_2?ie=UTF8&amp;s=books&amp;qid=1269781712&amp;sr=8-2" target="_blank">JavaServer  Faces 2.0, The Complete Reference</a> can already be bought. And in a month <a href="http://horstmann.com/corejsf/" target="_blank">Core JavaServer Faces 3rd edition</a> is coming. So if you want to give JSF a chance, at least read all the introductory articles like this one. <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a href="http://blog.frankel.ch/bean-validation-and-jsr-303" target="_blank">Bean validation and JSR 303</a></h3>
<p>One of the tasks of most of the web (and not only) applications is validating user input. Especially when the user enters some data in a form, it has to be checked whether it conforms to pre-defined rules. Sometimes the field should not be empty, other times it should be a number. Of course the business logic of the application can define very complex rules about the object attributes and the corresponding fields of the input forms.</p>
<p>As you can read from the article, back in the time there were two major validation frameworks: <a href="http://commons.apache.org/validator/" target="_blank">Apache Commons Validator</a> and the Action forms validator in <a href="http://struts.apache.org/" target="_blank">Struts</a>. The third player in the game is Hibernate. Its validator framework called <a href="http://www.hibernate.org/subprojects/validator.html" target="_blank">Hibernate Validator</a> is now the reference implementation of the <a href="http://jcp.org/en/jsr/detail?id=303" target="_blank">bean validation JSR</a>. In a nutshell, you just annotate your model classes with validation rules. Then in the business layer you just call the validator API to check whether all the rules are applied with the objects coming after the user input. This helps implementing the validation logic only once and not in every layer of the application. Easy and straightforward <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a href="http://www.jboss.org/feeds/post/performance_monitoring_using_hibernate" target="_blank">Performance monitoring with Hibernate</a></h3>
<p>The database performance is very important for the overall application efficiency. This article presents a special API from Hibernate that analyzes exactly that. Hibernate Statistics gives us valuable information about such things as number of executed queries, open transactions, loaded entities, etc.</p>
<p>The author of the article gives us a hint how this statistics can be used to monitor some common performance problems. You can also see how you can deploy your code as a Java EE library and use it seamlessly during your application&#8217;s runtime.</p>
<h3><a href="http://javafx.com/docs/articles/led-clock/" target="_blank">JavaFX digital clock</a></h3>
<p>And now something for the <a href="http://java.sun.com/javafx/" target="_blank">JavaFX</a> fans. This is the emerging Java visual technology with its own language (JavaFX script). With its help you can do compelling graphics and animation without writing the tons of code, inner classes, getters and setters required by Swing.</p>
<p>This article is very useful in that it is a step-by-step example of creating a real world (though simple) application. The author walks you through all the way from creating the project in NetBeans to running the application. Although declared as requiring intermediate skill level, it can be a perfect start even for those of you, who (like me) have only heard about the basic terms and benefits of JavaFX.</p>
<h3>Soft skills article of the week</h3>
<p>Most of the readers of this blog have at least once gone to a job interview. In most of the cases the employee candidates are usually the ones that answer the questions. The only thing that they really ask is the amount of the salary.</p>
<p>Not that it is not important, but according to the author of this <a href="http://www.noop.nl/2010/03/10-questions-to-ask-your-new-manager.html" target="_blank">short blog post</a>, there are at least 10 questions that you should ask your future boss on the job interview. If you have some experience in this area, you can post your ideas as comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/03/choice-of-the-week-122010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 11/2010</title>
		<link>http://nosoftskills.com/2010/03/choice-of-the-week-112010/</link>
		<comments>http://nosoftskills.com/2010/03/choice-of-the-week-112010/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 21:20:10 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=71</guid>
		<description><![CDATA[by Ivan St. Ivanov Is Java EE 6 too complicated? The people who back and evangelize Java EE 6 are very active the last few weeks. The blogosphere is full of posts, articles and webcasts on how easy it is now to develop with Java EE 6. The reason for that I guess is that [...]]]></description>
				<content:encoded><![CDATA[<h4>by Ivan St. Ivanov</h4>
<h3><a href="http://ocpsoft.com/java/why-doesnt-jpa-jma-jta-ejb-jsf-cdi-work-jee-is-too-complicated/" target="_blank">Is Java EE 6 too complicated?</a></h3>
<p>The people who back and evangelize Java EE 6 are very active the last few weeks. The blogosphere is full of posts, articles and  webcasts on how easy it is now to develop with Java EE 6. The reason for that I guess is that most of the people still think that Java is too slow to run and Java EE is too horrible and complex to develop.</p>
<p>Well, not that I have done much of EE development the last couple of years, but I can only agree with people like <a href="http://twitter.com/adambien" target="_blank">Adam Bien</a>. The different technologies in the EE stack are so well integrated now and the tooling (NetBeans, Eclipse, IDEA) is so well designed, that you can develop and deploy a simple web application in no time. If you don&#8217;t believe my humble opinion, you can <a href="http://twitter.com/adambien" target="_blank">follow</a> Adam on twitter.</p>
<p>By doing this I came across the short article, which I want to present you hereby. If you still have your concerns on Java EE&#8217;s horribleness, please do read the article and the comments below. It&#8217;s quite interesting.</p>
<h3><a href="http://in.relation.to/Bloggers/WeldJSF20AndGoogleAppEngineNavigatingTheMinefieldPart2" target="_blank">Weld, JSF 2.0 and Google App Engine, part 2</a></h3>
<p>Some time ago I recommended you reading the <a href="http://in.relation.to/Bloggers/WeldJSF20AndGoogleAppEngineNavigatingTheMinefieldPart1" target="_blank">first part</a> of this short series, where the author guided us in developing a simple web application, that is using Java contexts and dependency injection&#8217;s reference implementation (<a href="http://seamframework.org/Weld" target="_blank">Weld</a>) and JSF 2.0. The most interesting part was that it was configured for and deployed on Google&#8217;s cloud offering &#8211; <a href="http://code.google.com/appengine/" target="_blank">Google App Engine</a> (GAE for short).</p>
<p>In the second part the author focuses on several little details that would make your application run better on GAE. It includes database access optimization howtos, security, caching, JSF, logging and also a list of unsupported features. This is very important for those of you who have chosen GAE as deployment platform (for small sites with little traffic it&#8217;s perfect as it is free in such cases).</p>
<h3><a href="http://weblogs.java.net/blog/kalali/archive/2010/03/18/using-spring-security-enforce-authentication-and-authorization-spring" target="_blank">Using Spring Security and Spring Remoting together</a></h3>
<p>In this short article you can see how to wire and configure two of spring framework&#8217;s libraries &#8211; Spring Security and Spring Remoting, in order to run an application that exposes a web service on the server side and accesses it from the client side.</p>
<p>The Spring fans are a little bit quiet these days, but nevertheless Spring framework remains a full featured application stack that can be used for rapid and reliable application development both for the enterprise as well as for the home users. BTW this week I came upon <a href="http://www.infoq.com/presentations/New-in-dm-Server-2.0" target="_blank">this presentation</a> about <a href="http://www.springsource.org/dmserver" target="_blank">Spring DM server</a>. It is something like a true Java EE application server built on the OSGi technology. It has bundled all the necessary Spring libraries as well as all kinds of dependencies that you normally pack when you are developing a web application on Tomcat. And it does all the dependency injection and provides you all the helper classes that you would need to handle the resources through the whole stack of your application. And it is now free and open source, and it is <a title="Eclipse Virgo" href="http://www.eclipse.org/proposals/virgo/" target="_blank">part</a> of the Eclipse projects.</p>
<p>Wow, enough of Spring evangelizing from my side <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<h3><a href="http://martinfowler.com/articles/richardsonMaturityModel.html" target="_blank">Levels of REST architecture</a></h3>
<p>Martin Fowler has a very interesting approach of describing what REST is. It is actually inspired by a book on REST, which is in the process of writing and by a REST model that was presented elsewhere.</p>
<p>Martin develops the REST idea through discussing the implementation of a simple use case where he looks for the vacant hours of his doctor and tries to book one. The implementation goes through three levels of REST-fulness so that the reader can fully understand all the concepts of the protocol &#8211; resources, actions (or verbs) and resource representations.</p>
<h3><a href="http://www.jroller.com/ethdsy/entry/memory_saving_pattern_object_list" target="_blank">Memory saving pattern: object list</a></h3>
<p>Finally something in the core java area. Although it does not happen very often, we sometimes need to create a complex &#8220;multimap&#8221;. Author&#8217;s use case was a map, which values were lists of objects. The objects themselves were tuples of a String and int.</p>
<p>The author tested the performance and the memory consumption of three implementation of this structure. He first created a StringAndInt class that contains the tuple&#8217;s two properties. Then he checked how a HashMap that has a value ArrayList of this class performs in terms of memory. Next he tried the same thing, but instead of ArrayList, he put the new class into an array. The difference was quite small.</p>
<p>Finally putting the array inside the class (StringAndInt class containing arrays of ints and strings) improved much the performance. Why? Try it or read the article and you&#8217;ll find out. <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<h3><a href="http://hginit.com/" target="_blank">Introduction to Mercurial</a></h3>
<p>The distributed version control systems (like <a href="http://git-scm.com/" target="_blank">Git</a> or <a href="http://mercurial.selenic.com/" target="_blank">Mercurial</a>) are very much discussed and used these days. Shortly after announcing his &#8220;retirement&#8221; from active blogging, Joel Spolsky contributed this very helpful introduction to Mercurial.</p>
<p>It starts with a chapter for developers like me, that are used to the Subversion style of work. Well, people, if we want to be cool, we have to change our mindset. The least thing that we will get is committing at any time, from any place (even the plain) without bothering of breaking other people&#8217;s work or needing network access all the time. What else do Mercurial and other distributed version control system provide? Well, read the introductory tutorial&#8230; <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/03/choice-of-the-week-112010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 10/2010</title>
		<link>http://nosoftskills.com/2010/03/choice-of-the-week-102010/</link>
		<comments>http://nosoftskills.com/2010/03/choice-of-the-week-102010/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 20:46:23 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=57</guid>
		<description><![CDATA[by Ivan St. Ivanov JSF 2 navigation upon POST When writing a multi-page web applications, very often we give the user the possibility to enter some data in a form. When submitting the form, a POST HTTP request is generated from the browser to the server. If the web app just returns as a response [...]]]></description>
				<content:encoded><![CDATA[<h4>by Ivan St. Ivanov</h4>
<h3><a href="http://www.jboss.org/feeds/post/jsf2_navigation_post_redirect_get" target="_blank">JSF 2 navigation upon POST</a></h3>
<p>When writing a multi-page web applications, very often we give the user the possibility to enter some data in a form. When submitting the form, a POST HTTP request is generated from the browser to the server. If the web app just returns as a response the result page, and for some reason the user clicks the refresh button of the browser, then the POST request will be re-submitted. Which may not be what the intent of both the user and the developer are. That is why the web application developers usually do a redirect to the result page, which actually makes the browser to do a new (GET) request to it.</p>
<p>The author of the above short article shows how this <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get" target="_blank">POST-REDIRECT-GET pattern</a> is implement in JSF 2. However, the current state of the implementation may be sometimes quite tedious and error prone &#8211; the URI to redirect to together with all the parameters are returned as a single string by the action method.</p>
<p>The author applies another common pattern for building the URI and the parameters. It uses the <a href="http://en.wikipedia.org/wiki/Builder_pattern" target="_blank">builder pattern</a> together with a <a href="http://en.wikipedia.org/wiki/Fluent_interface" target="_blank">fluent interface</a>. This integrates very well with the JSF pages as well through the NamedBean concept. For more details on the exact implementation, you may check the article.</p>
<h3><a href="http://www.developer.com/services/article.php/3869941/article.htm" target="_blank">The foundation of an OSGi-based application</a></h3>
<p>Developer.com has started a series of articles on one of the most interesting topics in the industry &#8211; OSGi. The authors start with a very brief and short introduction on what OSGi is, how it emerged and what are its strengths. Then they introduce us to a case study for presenting how OSGi can be used in the practice.</p>
<p>The actual sample application performs user login to a certain user store (LDAP server in our case). In this installment you can see how it is all designed. The authors create two bundles &#8211; one for the user credential validation and one for the UI. They contain two and three services respectively and will be developed in the Eclipse Equinox environment. Thus the UI bundle will also use two eclipse plug-in extension points: splash screen and preference page.</p>
<p>This article contains just the requirements and design part of the application. In the next one we will hopefully read more on the implementation of the services and their integration with OSGi.</p>
<h3><a href="http://www.informit.com/guides/content.aspx?g=java&amp;seqNum=552" target="_blank">Class generation in Velocity</a></h3>
<p>The <a href="http://velocity.apache.org/" target="_blank">Apache Velocity</a> series on the <a href="http://www.informit.com/guides/guide.aspx?g=java" target="_blank">InformIT Java Reference Guide</a> continues this week with a more interesting example. After last week we were introduced into the project and created our first sample application, now we can see how can we generate all sorts of Java Beans.</p>
<p>The author creates an application that initializes a bean model class containing the package where our target bean resides and also its name and its fields together with their types.  Next he creates a utility class with one helper method that will be later used by the template. These both classes are put into the velocity context. Finally comes the template itself. There you can see how you can do conditional logic (if and else) in Velocity template language (VTL), how to implement cycles, how to define and access local variables, how to access model data and call methods of classes that are put in the context.</p>
<h3><a href="http://weblogs.java.net/blog/mhadley/archive/2010/03/10/declarative-hyperlinking-jersey" target="_blank">Declarative hyperlinking in Jersey</a></h3>
<p>When working with a REST-ful web service, sometimes you may need to code inside your app a link to a restful resource class in the form of a URI. For that you would use the <a href="https://jsr311.dev.java.net/nonav/releases/1.1/javax/ws/rs/core/UriBuilder.html" target="_blank">UriBuilder</a> class.</p>
<p>The author of this article provides us with some insight on what&#8217;s going on in the <a href="https://jersey.dev.java.net/" target="_blank">Jersey</a> development these days. Jersey is the <a href="http://jcp.org/en/jsr/detail?id=311" target="_blank">JAX-RS </a>reference implementation so this blog post might be interesting for all of you who are developing or using RESTful web services.</p>
<p>So instead of using the UriBuilder to build a URI variable, the author proposes to annotate it with a new annotation. It is supposed to support all kinds of resource paths and parameters. Remember, it is a work in progress, but it&#8217;s worth taking a minute to look at it.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/03/choice-of-the-week-102010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 09/2010</title>
		<link>http://nosoftskills.com/2010/03/choice-of-the-week-092010/</link>
		<comments>http://nosoftskills.com/2010/03/choice-of-the-week-092010/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 20:09:08 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=54</guid>
		<description><![CDATA[by Ivan St. Ivanov Last week I was not able to complete my regular review blog post. That is why today I will try to make up. I will link here articles not only from the last seven days, but also from the eighth week of the year. Read on! Runtime compiling and running java [...]]]></description>
				<content:encoded><![CDATA[<h4>by Ivan St. Ivanov</h4>
<p>Last week I was not able to complete my regular review blog post. That is why today I will try to make up. I will link here articles not only from the last seven days, but also from the eighth week of the year. Read on!</p>
<h3><a href="http://www.javaspecialists.eu/archive/Issue180.html" target="_blank">Runtime compiling and running java classes</a></h3>
<p>Issue 180 of the <a href="http://www.javaspecialists.eu" target="_blank">Java specialists newsletter</a> is out. There the Java champion Heinz M. Kabutz describes how during the runtime of your program you get a String (actually a <code>CharSequence</code>) representing a java class, compile it and run in the same classloader as your main program.</p>
<p>As of Java 6, inside the <code>javax.tools</code> package (part of JDK&#8217;s tools.jar, not in JVM) you can find Java compiler API. That is what the author uses for compiling the string representing the source code into a class. After that he loads the generated class file into the current classloader and starts it (the example source represents a thread).</p>
<p>The author avoids to enter the classloader hell so he does not actually define a child classloader of the current one and run the generated class there. He actually generates a dynamic proxy of the generated class by calling the <code>defineClass0</code> static method of the <code>java.lang.reflect.Proxy</code> class. As this is not a public method, it is invoked via reflection and before that it is explicitly made accessible.</p>
<p>Beware that this article requires much attention in order to understand. I also advise playing around with the sample code by merely doing it by yourself.</p>
<h3><a href="http://java.dzone.com/articles/fast-integer-sorting-algorithm" target="_blank">Fast O(n) integer sorting algorithm</a></h3>
<p>Another core java article this week. Actually this one is dealing with concept common for most of the programming languages &#8211; sorting algorithms.</p>
<p>Here you can find a way to sort a huge array of <strong>positive</strong> integers. One peculiarity about this array is that its length should be about 2500 smaller than its greatest element. For example if the greatest element is 1 000 000 (one million), then for optimal results (and for a working algorithm at all), the length of the array should be about 40 000 elements.</p>
<p>The key for this sorting algorithm with linear complexity (O(n)) is that it uses the indexes of a temporary array. The original array is looped through. For each number there the element under the index of the temporary array which corresponds to the number of the original array is increased by one. For example if the first element of the array to sort is 5, then tempArray[5] is increased by one. In the end the temporary array is looped through and all its indexes, which element is greater than 0, are entered in the original array. And it is entered as many times, as great is the element in the temporary array.</p>
<p>Just look at the <code>sort(int[], int, int)</code> method in the sample code to get a better feeling.</p>
<h3><a href="http://agoncal.wordpress.com/2010/03/03/bean-validation-with-jpa-1-0/" target="_blank">Bean validation and JPA</a></h3>
<p>Back in the days, when you wrote your web application (and not only web), you had to validate the user input in possibly different layers of the program. With Bean Validation it is no longer needed. Now you can annotate your model classes (java beans) with annotations like <code>@NotNull</code>, <code>@Max</code>, <code>@Min</code>, <code>@Past</code>, etc. These annotations are all specified in <a href="http://jcp.org/en/jsr/detail?id=303" target="_blank">JSR 303</a> &#8211; bean validation. And it comes from the <a href="https://www.hibernate.org/412.html" target="_blank">Hibernate Validator</a> project, which is the reference implementation of the specification.</p>
<p>The author of this short blog entry first shows how easy it is to use bean validation with JPA 2.0. If you combine that with view technologies like JSF, the triggering of the validation process comes out of the box, without the need of you calling any validate() method on the API.</p>
<p>With JPA 1.0 is not so straightforward, but the validation can be activated there as well with the help of implementing you own JPA entity listener, which will execute the validation on certain entity manager events (like pre-persist, pre-update or pre-remove).</p>
<p>Finally the author asks Emmanuel Bernard &#8211; the spec lead of the bean validation JSR, what is the reason for validation upon deleting an entity. Which Emmanuel <a href="http://www.jboss.org/feeds/post/why_can_i_call_bean_validation_when_i_remove_an_entity_in_jpa_2" target="_blank">answers</a> in his blog, where he describes a usecase, where an order has to be paid (i.e. its isPaid flag should be set) before it gets removed.</p>
<h3><a href="http://java.dzone.com/articles/search-engine-basics" target="_blank">Search engine basics</a></h3>
<p>If you are wondering how search engine (like Google) work, then this article is for you. It keeps the balance of not going too much in the details and in the same time not staying too much on the surface.</p>
<p>So, the search engines have four main functions.</p>
<p>1) They are &#8220;crawling&#8221; the internet pages and downloading new content locally</p>
<p>2) They are indexing each single word in the page they downloaded and are building a big table of all the relevant words and terms from the page</p>
<p>3) Upon user query they are looking for pages that potentially match the query string</p>
<p>4) The found pages are ranked based on their relevance</p>
<p>If you are interested in more details about the above steps and what are the challenges that the search engine developers are facing, then go and read this posting.</p>
<h3><a href="http://today.java.net/article/2010/03/03/rethinking-multi-threaded-design-priniciples" target="_blank">Rethinking multi-threaded design principles</a></h3>
<p>With the advance of the hardware industry and the growing number of multi-core processors, writing multi-threaded applications is becoming more and more popular. But how to write an applications that is thread-safe (one thread does not touch the data of another one) and in the same time don&#8217;t make it so restrictive that it finally performs like a single-threaded app?</p>
<p>The above article summarizes the design principles in this direction. It starts by looking at the application data model, which is the most common shared resource between different threads. Next the author discusses some thread-safe structures that are part of the JDK. And finally discusses the ways to avoid deadlocks between different threads.</p>
<h3><a href="http://www.informit.com/guides/content.aspx?g=java&amp;seqNum=550" target="_blank">Introduction to Apache Velocity</a></h3>
<p><a href="http://velocity.apache.org/" target="_blank">Apache Velocity</a> is the most common template engine in the industry. Its basic idea is to generate resources of a certain kind (XML, DB scripts, HTML) from a template based on a model data. A very good example of what a template engine does are the JSP pages. They contain some static HTML code as well as some templates. These templates are translated at runtime based on a model (usually a map of java beans) &#8211; the variables in the template are substituted with the real values coming from the model beans (usually the engine calls the beans getter methods).</p>
<p>If you are already interested in the matter, then go to the first article from the new series on Apache Velocity presented in the InformIT&#8217;s <a href="http://www.informit.com/guides/guide.aspx?g=java" target="_blank">reference guides collection</a> &#8211; by far the richest java guides collection I&#8217;ve seen. In the first installment you can see the above concepts explained in more details with the usual Hello World example at the end. Of course the next series will show the power of Velocity engine and its template language.</p>
<h3><a href="http://weblogs.java.net/blog/jitu/archive/2010/02/19/jax-ws-cdi-java-ee-6-0" target="_blank">JAX-WS + CDI in Java EE 6</a></h3>
<p>Another short article on one of the most valuable new features of Java EE 6 &#8211; Contexts and Dependency Injection. This is a specification (<a href="http://jcp.org/en/jsr/detail?id=299" target="_blank">JSR 299</a>) that with the help of the annotations from <a href="http://jcp.org/en/jsr/detail?id=330" target="_blank">JSR 330</a> (Dependency Injection for Java) defines a way to inject common resources (data sources, transaction managers, other beans) to Java EE managed beans. The latter may be simple session EJBs, JSF backing beans, web services etc. Not only that, but the specification defines a way to configure the scope and the lifecycle of a bean.</p>
<p>In the sample application created by the blog author, he develops a simple shopping cart web service, where he injects a shopping cart bean (not EJB, but simple Java bean). The latter is configured to be session scoped, which means that the application server will create a new shopping cart for each HTTP session.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/03/choice-of-the-week-092010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Choice of the week &#8211; 07/2010</title>
		<link>http://nosoftskills.com/2010/02/choice-of-the-week-072010/</link>
		<comments>http://nosoftskills.com/2010/02/choice-of-the-week-072010/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 12:56:11 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=53</guid>
		<description><![CDATA[Embed Glassfish in an existing OSGi environment OSGi is something that is very fashionable in the industry these days. Every big software company makes sure that its products are running inside OSGi environment. Besides the &#8216;cloud&#8217;, OSGi is one of the most used buzzwords today. Glassfish is the reference implementation application sever of the Java [...]]]></description>
				<content:encoded><![CDATA[<h3><a href="http://weblogs.java.net/blog/ss141213/archive/2010/02/14/how-embed-glassfish-existing-osgi-runtime" target="_blank">Embed Glassfish in an existing OSGi environment</a></h3>
<p><a href="http://www.osgi.org/Main/HomePage" target="_blank">OSGi</a> is something that is very fashionable in the industry these days. Every big software company makes sure that its products are running inside OSGi environment. Besides the &#8216;cloud&#8217;, OSGi is one of the most used buzzwords today.</p>
<p><a href="https://glassfish.dev.java.net/" target="_blank">Glassfish</a> is the reference implementation application sever of the Java EE specification. It is itself built of modules that are run and managed by an OSGi environment. So the question that the author of the article answers is whether it can be bundled in another OSGi framework. <a href="http://www.eclipse.org/equinox/" target="_blank">Equinox</a> is used for that purpose.</p>
<p>The author has developed a simple bundle activator. As Glassfish is itself modularized, the task of the bundle is to walk through the modules directory, register the modules that it finds there with the OSGi runtime, find Glassfish&#8217;s main bundle and to start it.</p>
<p>Very interesting post for those of you, who have some experience in the OSGi bundle business.</p>
<h3><a href="http://www.ibm.com/developerworks/java/library/wa-aj-richjava/index.html?ca=drs-" target="_blank">Rich Java web applications with Apache Wind and AJAX</a></h3>
<p>After last week we read an article about one of Apache&#8217;s JAX-WS libraries (<a href="http://cxf.apache.org/" target="_blank">Apache CXF</a>), now IBM developers works give us ASF&#8217;s proposal for the other web services standard &#8211; JAX-RS. <a href="http://incubator.apache.org/wink/" target="_blank">Apache Wink</a> is still an incubator project, but nevertheless you can see that it works great. It provides support for both the server side part for developing the web services as well as for the client part for consuming them.</p>
<p>The author explains in the beginning the benefits of JAX-RS: it is easier to use and understand than JAX-WS and the format (or the payload) of the documents that are transmitted between the communicating parties, is not always XML.</p>
<p>The last thing is actually elaborated in more details &#8211; in the example application the data is transmitted via <a href="http://www.json.org/" target="_blank">JSON</a>. It is less verbose than XML and there are plenty of libraries that convert a JSON file to an object and vice versa.</p>
<p>The second part of the article is for developing the client side of the application. As it is a web application, you can imagine that the author builds some web pages. One of the most popular technologies here is <a href="http://www.w3schools.com/Ajax/Default.Asp" target="_blank">AJAX</a>. Through AJAX, you can execute server request from within java script code of your page without the need reload the whole page. The combination of java script code and quick response time makes the AJAX-ified web applications look and behave nearly like desktop ones.</p>
<p>By reading the article you will not only get hands-on experience in building REST-ful web services, but you will learn how to combine it with the JSON format and how to call the web services from AJAX.</p>
<h3><a href="http://www.informit.com/guides/content.aspx?g=java&amp;seqNum=548" target="_blank">Short introduction to XML schemas</a></h3>
<p>Continuing with the web services in this blog, I present you a short introduction to one very important aspect of the JAX-WS world: the XML schemas.</p>
<p>These are documents that describe the order and type of the XML elements in a document. XML schema documents are very useful for both validating the XML content and also for generating objects from XML. It is a successor of the document type definition (DTD) format, which most of you should know and maybe worked with. By applying XML namespaces, you can have an XML document, which uses and conforms to several XML schemata.</p>
<p>If you need a quick intro and do not have the time to go through the detailed <a href="http://www.w3schools.com/" target="_blank">w3c schools</a> tutorials, then this is the article for you. You can also browse Inform IT&#8217;s <a href="http://www.informit.com/guides/guide.aspx?g=java" target="_blank">Java guide</a> section for another topic that might be interesting.</p>
<h3><a href="http://martinfowler.com/bliki/VersionControlTools.html" target="_blank">Version Control Tools</a></h3>
<p>Another article by Martin Fowler. Virtually all the world developers work with version control tools. You use them everywhere, even for the open source projects that you develop by yourself. If you are not using one for your project, then you should consider choosing. As the author points version control tools are used for both tracking the different versions of the code you develop and also for collaboration.</p>
<p>There are a lot of tools that help us in that. The author reviews three of them, but before that he mentions which are the tools, the he would never use. He classifies the good tools in two groups &#8211; with centralized repository and with distributed repository.</p>
<p>If you want to understand more about the differences between <a href="http://subversion.tigris.org/" target="_blank">Subversion</a>, <a href="http://mercurial.selenic.com/" target="_blank">Mercurial</a> and <a href="http://git-scm.com/" target="_blank">Git</a>, then go and read the short article.</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/02/choice-of-the-week-072010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Choise of the week &#8211; 06/2010</title>
		<link>http://nosoftskills.com/2010/02/choise-of-the-week-062010/</link>
		<comments>http://nosoftskills.com/2010/02/choise-of-the-week-062010/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 21:42:49 +0000</pubDate>
		<dc:creator>ivko3</dc:creator>
				<category><![CDATA[Ivko's choice of the week]]></category>

		<guid isPermaLink="false">http://nosoftskills.com/?p=49</guid>
		<description><![CDATA[This is the week of the web services (both kinds) articles. And some hard skills for dessert. Comparing JAX-RS and Spring MVC Before going into details about the above article, I would give you a short introduction in the abbreviations you see. JAX-RS stands for Java API for RESTful Web Services. This API provides standard [...]]]></description>
				<content:encoded><![CDATA[<p>This is the week of the web services (both kinds) articles. And some hard skills for dessert.</p>
<h3><a href="http://www.infoq.com/articles/springmvc_jsx-rs">Comparing JAX-RS and Spring MVC</a></h3>
<p>Before going into details about the above article, I would give you a short introduction in the abbreviations you see. <a href="http://jcp.org/en/jsr/detail?id=311" target="_blank">JAX-RS</a> stands for Java API for RESTful Web Services. This API provides standard interfaces (or rather annotations) that turns your POJO class into a RESTful application. This REST abbreviation stands for REpresantational State Transfer. As opposed to the standard web services, which are more thought as providing some remote functions to be called, the REST services build on the paradigm of providing resources, that have a path in the form of a URI (or URL), they have a type (the HTTP mime types &#8211; XML, text, HTML, PDF, etc.). As REST is carried by the HTTP protocol, the web service&#8217;s functions are annotated and correspond to the four HTTP request types &#8211; get, put, post, delete. So, the web service that you develop live in a container that supports the REST protocol (<a href="https://jersey.dev.java.net/" target="_blank">Jersey</a> is the reference implementation and is part of <a href="https://glassfish.dev.java.net/" target="_blank">Glassfish v3</a>). The web service annotates its methods with one of the annotations representing HTTP request type and also indicates to which URL it responds. Usually, the latter is a relative path following the hosting server address. When the server receives a request for a path, it dispatches it to the corresponding web service method. For more information, you can search for the various resources in Internet.</p>
<p><a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html" target="_blank">Spring MVC</a> is Springsource&#8217;s Model-View-Controller technology. Its main job is provide easy to use way for our web applications to handle incoming requests, invoke the appropriate business logic and based on that build the response. In Spring 3.0 this is easier more than ever. It is achieved with minimal configurations, most of which is part of the class definitions in the form of annotations. Another thing in the latest version is that Spring controllers are REST-oriented: each of them maps to a specific path in the URL, each if its methods correspond to a specific request type and sub-path of the original type.</p>
<p>If you were not familiar with these technologies, then it would be great to read something about them, as especially JAX-RS and REST are getting momentum right now. If you already know the basics, then <a href="http://www.infoq.com/articles/springmvc_jsx-rs" target="_blank">the article</a> is for you. The author does not actually try to compare them and judge which is the better one. He rather shows how a technology like Spring MVC, that was initially designed for web application development, can be used as a JAX-RS container. It supports most of the specification&#8217;s common features. Very interesting article by the fellow Bulgarian blogger, who BTW works for Springsource <img src='http://nosoftskills.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<h3><a href="http://www.ibm.com/developerworks/java/library/j-jws12.html?ca=drs-" target="_blank">Introducing CXF</a></h3>
<p><a href="http://cxf.apache.org/" target="_blank">Apache CXF</a> is a web services framework built by the Apache Software Foundation. It supports both types of web services &#8211; JAX-WS (including most of the standards under its umbrella) and JAX-RS. It can both create java classes from WSDL files and vice versa.</p>
<p>The IBM developer works article is third in a series presenting web service frameworks. The author compares Apache CXF to <a href="http://ws.apache.org/axis2/" target="_blank">Axis2</a> (again from Apache) and to <a href="https://metro.dev.java.net/" target="_blank">Metro</a> (from Sun). He shows later on how you can create a simple web service (the server and the client side) for searching a book library. This very same sample was built in the previous two installments of the series with the other two web service stacks.</p>
<h3><a href="http://marxsoftware.blogspot.com/2010/02/jax-rs-with-jersey-introduction.html" target="_blank">Introduction to JAX-RS with Jersey</a></h3>
<p>This article is for those of you who have a vague understanding of what RESTful web services are, but have no experience with implementing those in Java. The author does not really go into details about how REST works, what do the different annotations mean, etc. He puts more emphasis on how to pack and access your POJOs in a server that used Jersey (the reference implementation for JAX-RS).</p>
<p>Glassfish v3 is chosen as an app server, though it is not obligatory. When you install it, you get Jersey for free. By reading the article, you will find in great detail how to configure the web.xml, how to deploy the war file, and then how to access it. It is also accompanied with fistful of screenshots.</p>
<h3><a href="http://www.infoq.com/articles/brown-are-you-a-software-architect" target="_blank">Are you a software architect?</a></h3>
<p>The role of the software architect is assumed to be taken by the most experienced developers in the team. However, is that the only thing that the architect  should possess &#8211; experience?</p>
<p>According to the author, the architecture process can be broken into two phases: architecture definition and architecture delivery. These two phases are additionally broken down into five elements each. All these elements are discussed in details. Read on and answer the question: <em>Are you a software architect</em>?</p>
]]></content:encoded>
			<wfw:commentRss>http://nosoftskills.com/2010/02/choise-of-the-week-062010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
