<?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>Christian Grobmeier - JEE, EAI, PHP &#187; Java</title>
	<atom:link href="http://www.grobmeier.de/tag/java/feed" rel="self" type="application/rss+xml" />
	<link>http://www.grobmeier.de</link>
	<description>A Blog about technical thoughts</description>
	<lastBuildDate>Wed, 02 Jun 2010 12:32:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Book review: Apache Geronimo Quick Reference</title>
		<link>http://www.grobmeier.de/2009/12/09/apache_geronimo_quick_reference_review.html</link>
		<comments>http://www.grobmeier.de/2009/12/09/apache_geronimo_quick_reference_review.html#comments</comments>
		<pubDate>Wed, 09 Dec 2009 13:19:12 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Bookreview]]></category>
		<category><![CDATA[Geronimo]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=275</guid>
		<description><![CDATA[Apache Geronimo book. A real quick reference, sometimes to quick]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-271" title="Apache Geronimo Book" src="http://blog.grobmeier.de/wp-content/uploads/2009/11/1847196942-243x300.jpg" alt="Apache Geronimo Book" width="243" height="300" />I recently got a copy of <a href="http://www.amazon.de/gp/product/1847196942?ie=UTF8&amp;tag=neoteccde-21&amp;linkCode=as2&amp;camp=1638&amp;creative=19454&amp;creativeASIN=1847196942">Apache Geronimo 2.1: Quick Reference</a><img style="border:none !important; margin:0px !important;" src="http://www.assoc-amazon.de/e/ir?t=neoteccde-21&amp;l=as2&amp;o=3&amp;a=1847196942" border="0" alt="" width="1" height="1" />. This book should help me with my first steps with this container. Here is a little review for this brand new release of Packt publishing.</p>
<p>My first impression was: wow, is that really a quick reference? The book has a good format and comes with roundabout 370 pages. I hoped for a short book in these times I don&#8217;t have too much time for huge novels in the kind of &#8220;Gone with the wind&#8221;. However, I jumped through the content and figured out that this is actually a quick reference  - very good for the impatient developers like me!</p>
<p>In fact, this book covers all relevant topics I can imagine: it starts with an introduction and a description of Geronimos architecture, which gives an brief (sometimes a bit short) overview of how Geronimo works with its plugins and its deployment strategy. I would have loved to read a bit more about the &#8220;hot deployment&#8221; feature of Geronimo. In JBoss world, this has brought me some headache. In this book it&#8217;s only covered with roundabout one page, just saying that it exists, were you need to place your files and how you can monitor that activity. Even later it&#8217;s not mentioned in special. Well, but that&#8217;s ok for a Quick Reference.</p>
<p>After this, one gets in touch with the most important knowledge of JMS, Database connectivity and JPA. Then there is an extraordinary good chapter about Security. Its one of the biggest chapters in this book and one can feel quite well how expierenced these guys are. Topics are handled in some kind of How-To way, like &#8220;Creating a new keystore&#8221; or &#8220;Changing a private key password&#8221;. These guys know what they speak about, probably the best chapter in this book.</p>
<p>Then it comes to CORBA, which I found also interesting, but to short in general. JNDI was reduced to the most important &#8220;put your hands there&#8221; information. Then it comes to Geronimo Plugins. This one was very interesting too and I wished to read more about it, but well, again, it&#8217;s short reference.  You can find much Listings in this chapter, but I cannot say that they helped me too much without digging in the containers documentation.</p>
<p>In the administration chapter, the authors show the different portlets Geronimo provides for monitoring actions. It&#8217;s basically a walk through of the different pages of the Geronimo console. I think, this chapter could have been improved much more. For example, the Thread Pools Portlet is described with just one sentence: &#8220;&#8230;lists the thread pools defined in the server, and lets you monitor the thread pools.&#8221;. Ok, I don&#8217;t need a book for that information. Some other portlets are described a bit more in detail, but nothing which makes me to a Geronimo Guru.</p>
<p>Later you will have a How-To use the Geronimo Eclipse Plugin. It contains lots of screenshots which helps you to create a project specifically for the Geronimo. More impressive was the Cluster chapter. Clustering is a difficult topic and I would use this section for doing the job. It&#8217;s a good mix between explanation and reference.</p>
<p>Last chapter I was eager to see was the one with the Geronimo Internals. At some parts it reads like a smaller version of an API. It should help to develop own GBeans and it does, but not so much that I would have a huge benefit compared to the docs.</p>
<p>Final words: this one is really a reference and not a teaching book. If you would like to buy it, you should have some knowledge about JEE and about Containers in general. This book will not help you to understand the technologies behind. It&#8217;s more a collection of How-Tos, and that is what I expected from a Quick Reference. The authors made this point clear on the cover, were they are stating that you need to know about JEE5 concepts. At some points I would have preferred some more information. Sometimes I would have wished that they put not so much unnecessary listings (I don&#8217;t need import statements in java listing nor do I need XML-Comments in a 10 line XML file). I think, if you are developing an application, this book is a nice to have. If you are more an administrator and need to develop, package or cluster Geronimo, this book will probably give you some benefits. Especially the security chapter is well done.</p>
<p>However, thanks for this book, I like it, but it&#8217;s not one of my all-time faves.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/12/09/apache_geronimo_quick_reference_review.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First steps into Apache Geronimo</title>
		<link>http://www.grobmeier.de/2009/11/18/first-steps-into-apache-geronimo.html</link>
		<comments>http://www.grobmeier.de/2009/11/18/first-steps-into-apache-geronimo.html#comments</comments>
		<pubDate>Wed, 18 Nov 2009 07:04:45 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Geronimo]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=270</guid>
		<description><![CDATA[Apache Geronimo Book on Packt Publishing.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-medium wp-image-271" title="Apache Geronimo Book" src="http://blog.grobmeier.de/wp-content/uploads/2009/11/1847196942-243x300.jpg" alt="Apache Geronimo Book" width="243" height="300" />The last weeks I struggled with JavaScript. I hated it quite soon, but with knowledge came some comfort and finally I am now able to use jQuery without too much pain. Let&#8217;s hope that I don&#8217;t have requirements which need a deep knowledge of that stuff <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  However, that brought me to the idea (as odd as it sounds) to try out some server side javascript. It was exactly the right time when Packt Pub. contacted me about <a href="http://www.packtpub.com/apache-geronimo-2-2-quick-reference/book" target="_blank">their new book on Apache Geronimo</a>.</p>
<p>I wanted to step into Geronimo before a few years, but JBoss, Weblogic and even Websphere were used on my projects. No time for playing with Geronimo. Well, but with this book I will start finally and check out whats possible with this little beast <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>From the table of contents, server side javascript seems not to be on the list. But thats not to bad &#8211; I think I have a new idea for a blog post.</p>
<p>However, I am looking forward to this book. Packt already informed that it&#8217;s on the way to me. So far a very good impression of this publisher. Polite people, quick delivery. Let&#8217;s see how good the book is.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/11/18/first-steps-into-apache-geronimo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tika uses Commons Compress</title>
		<link>http://www.grobmeier.de/2009/07/31/tika-uses-commons-compress.html</link>
		<comments>http://www.grobmeier.de/2009/07/31/tika-uses-commons-compress.html#comments</comments>
		<pubDate>Fri, 31 Jul 2009 10:42:13 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Commons Compress]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=247</guid>
		<description><![CDATA[Tika is using Commons Compress]]></description>
			<content:encoded><![CDATA[<p>It just came in with a newsletter: Tika 0.4 is using Commons Compress from now on. Thats really great! It&#8217;s the first big app I know which is using Commons Compress. Hopefully that motivates me to get back bugfixing Compress in near future <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>More TIKA changes: http://www.apache.org/dist/lucene/tika/CHANGES-0.4.txt</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/07/31/tika-uses-commons-compress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN Properties &#8211; Client Config</title>
		<link>http://www.grobmeier.de/2009/07/05/svn-properties-client-config.html</link>
		<comments>http://www.grobmeier.de/2009/07/05/svn-properties-client-config.html#comments</comments>
		<pubDate>Sun, 05 Jul 2009 18:45:54 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=237</guid>
		<description><![CDATA[How to set our SVN defaults for Apache on Mac OSX.]]></description>
			<content:encoded><![CDATA[<p>You  know I am working on several open source projects, and lately one of my comrades told me I should stop coding asap and:&#8221;please correct your client configs I don&#8217;t want to fix the stuff anymore.&#8221;. This shout made me think about my bad behaviour and to be honest, I didn&#8217;t know why I should do this and how.</p>
<p>After some small googling, I figured out that the most cool feature of the SVN properties is to ensure that if you check out something from repository, you&#8217;ll get the line endings you need.</p>
<p><em> &#8220;In other words, if a user on a                 Windows machine checks out a working copy that                 contains a file with an                 <tt class="literal">svn:eol-style</tt> property set to                 <tt class="literal">native</tt>, that file will contain                 <tt class="literal">CRLF</tt> EOL markers.  A Unix user                 checking out a working copy which contains the same                 file will see <tt class="literal">LF</tt> EOL markers in his                 copy of the file.&#8221;</em></p>
<p>Quote from: http://svnbook.red-bean.com/en/1.1/ch07s02.html#svn-ch-7-sect-2.3.5</p>
<p>So, this is client config. That means YOU have to make sure that you add your files with the correct properties. Let&#8217;s assume you want to add a file named test.txt. You would do:</p>
<pre>svn add test.txt</pre>
<p>After adding you need to perform:</p>
<pre>svn propset -R svn:eol-style native test.txt</pre>
<p>to set the properties correctly.</p>
<p>Having that beeing said. most people will complain now that this is a difficult task and very error proven. Well it is. But you don&#8217;t have to take care if you are sure that only one operating systems (means: one development enviroment)  is set up. This is true for most projects I guess.</p>
<p>If it is NOT the case, you can force your developers to create a default config setup. On windows it just some entries in the registry (<a href="http://svnbook.red-bean.com/en/1.1/ch07.html#svn-ch-7-sect-1" target="_blank">please try this</a>, I am not using windows for open source stuff anymore), on Mac OS X and Linux the file ~/.subversion/config must be edited.</p>
<p>In my case, this did do the trick:</p>
<pre>[miscellany]
enable-auto-props = yes</pre>
<pre>
[auto-props]
*.java = svn:mime-type=text/plain;svn:eol-style=native
*.css = svn:mime-type=text/plain;svn:eol-style=native</pre>
<p id="sebb">or at least mostly.  SVN told me, after I wanted to change properties to native, that my css files were binary, which this wasn&#8217;t the case, of course! I couldn&#8217;t change it, until Sebastian Bazley came up with the following:</p>
<pre>svn pl -v</pre>
<p>showed:</p>
<pre>Properties on 'maven.css':</pre>
<pre>  svn:mime-type</pre>
<pre>    application/octet-stream</pre>
<p>He further told me to do:</p>
<pre>svn pd svn:mime-type maven.css</pre>
<p>And that was it &#8211; SVN is forced to use mime type I want.</p>
<p>Last but not least, <a href="http://www.apache.org/dev/svn-eol-style.txt" target="_blank">here is the link to the apache recommendation or SVN config</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/07/05/svn-properties-client-config.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaMagazin article about Commons Compress</title>
		<link>http://www.grobmeier.de/2009/07/03/javamagazin-article-about-commons-compress.html</link>
		<comments>http://www.grobmeier.de/2009/07/03/javamagazin-article-about-commons-compress.html#comments</comments>
		<pubDate>Fri, 03 Jul 2009 10:46:27 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Commons Compress]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Authoring]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=243</guid>
		<description><![CDATA[JavaMagazin released article about Commons Compress in issue 08 2009]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-244" title="javamagazin82009" src="http://blog.grobmeier.de/wp-content/uploads/2009/07/javamagazin82009.jpg" alt="javamagazin82009" width="200" height="285" />In the latest edition of the JavaMagazin you&#8217;ll find a small introduction into Apache Commons Compress. It&#8217;s not explaining everything, just a good start. Having this beeing said, I think I should note that this one has been written by myself <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  &#8211; consider this blog entry as shameless self promotion. <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>However, if you read the article: please enjoy. If there are any further questions about the usage of Commons Compress, consider to <a href="http://commons.apache.org/mail-lists.html">add yourself to the mailinglists</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/07/03/javamagazin-article-about-commons-compress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some words about unit testing &#8211; Junit, PhpUnit</title>
		<link>http://www.grobmeier.de/2009/05/27/some-words-about-unit-testing-junit-phpunit.html</link>
		<comments>http://www.grobmeier.de/2009/05/27/some-words-about-unit-testing-junit-phpunit.html#comments</comments>
		<pubDate>Wed, 27 May 2009 20:16:13 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Apache Log4PHP]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=218</guid>
		<description><![CDATA[What is Unit testing?]]></description>
			<content:encoded><![CDATA[<h1>Unit Testing with Junit and PHPUnit</h1>
<p>All the worlds speaks about testdriven development and unit testing. But most people finishing there exams don&#8217;t have a clue about what this means. To be honest, I was surprised that people could get out of a university just with one or two Junit tests implemented. Well, here are some words about testing.</p>
<h2>What is a unit test?</h2>
<p>A unit test is nothing else than some lines of test code which tries to check out if the lines of business logic you wrote actually works. To help you with this, tools like JUnit and PHPUnit (or SimpleTest in PHP enviroment) have been written. They are frameworks which give you some methods to work with. To be clear: a unit test is some kind of class which instantiates another class and checks if the parameters you put in bring the correct results.</p>
<h2>What does testdriven development mean?</h2>
<p>Hardcore people say, before you write the business logic, you&#8217;ll have to write a test case. This is test driven development: write your test, then write the actual business logic. For me it works usually like this: I write my business logic and as soon as I have something cool working, I write a testcase. Sometimes it behaves a bit different. Depends on. But thats a matter of taste. As usual I recommend not to be to extreme about everything and just try out what is best for you.</p>
<h2>What and how much to test?</h2>
<p>Everything. Well, not really. A good testing ratio is at 70%. More does mean that you even test your exceptions, less means you have forgotten some classes. There are tools available which help you with checking out how much you have tested. In Javaworld its Cobertura, in PHP its Spike PHP Testcoverage, for example.</p>
<h2>How does a testcase look like?</h2>
<p>Usually you have to extend your tester class from a class called TestCase or similar. In PHPUnit its PHPUnit_Framework_TestCase. They make your classes executable in the testing enviroment. Then implement methods &#8211; all methods which implement an actual test is prefixed with test.</p>
<p>An example from Log4PHP:</p>
<pre>class LoggerLayoutHtmlTest extends PHPUnit_Framework_TestCase {
    public function testErrorLayout() {</pre>
<p>The testing frameworks usually look for methods like this and execute them one by one. In newer JUnit Versions you have to annotate testing methods. OK, and this is a valid PHP testcase:</p>
<pre>public function testErrorLayout() {
        $event = new LoggerLoggingEvent("LoggerLayoutHtmlTest", new Logger("TEST"), LoggerLevel::getLevelError(), "testmessage");
        $layout = new LoggerLayoutHtml();
        $v = $layout-&gt;format($event);
        $e = "blub";
        self::assertEquals($v, $e);
    }</pre>
<p>Again, its Log4PHP. I instantiate a class which I am intending to test and call a method on it. The result is stored in $v. What I expect is stored in $e. All testing frameworks provide you so called assert methods, which enable you to compare or check otherwise if the expectation meets the actual result. In my case, &#8220;blub&#8221; is expected. If this assertion fails, my tool shows me that error.</p>
<h2>Why is it necessary to keep old tests?</h2>
<p>If you change business logic or refactor something you can simply execute old tests and recognize if something goes wrong. People say, before putting an echo or System.out.prinln somewhere, write an test. I agree here. A good testing ratio makes your software stable and you take care of side effects, even when software grows. And before you deliver you run all your tests. This way you make sure that everything is fine.</p>
<h2>Test Data and dependend Tests</h2>
<p>To make it short, test methods should never depend on the success of  test methods. Each test method can be executed stand alone. Otherwise your life will be hell &#8211; think on thousand methods depending on each other. Same goes to test data. A testcase must not depend on data another test method created. This will cause you hell.</p>
<p>I know that this is very difficult  with databases. Testframeworks usually give you &#8220;tearUp&#8221; or &#8220;tearDown&#8221; methods which are called before a test method starts. You can create your testdata in the databases in these methods. But this is very time consuming. Test executions of this kind can easily take hours. Best is, keep your tables short, make a SQL file for each package or even each test case. There are no best practices which fits on each project.</p>
<p>In my last project we have used Excel (=Manager aware) to take care of the data and then generated SQL files out of it. Time consuming, complex, but it worked. The relations in this tables where to strong, we couldn&#8217;t keep the data care up otherwise.</p>
<h2>Testing helps coding</h2>
<p>Having said the above, you can imagine that you should think about testability BEFORE you code. Spaghetthi code isn&#8217;t testable. Make short methods. Keep in mind what &#8220;Separation of Concerns&#8221; means. Same goes to databases. Make them plugable. Not at all time foreign keys are good. Think about it twice &#8211; they are mighty but can be evil too. I have worked in projects where it was very heavy duty or even impossible to delete any data. If you write your application testable, its going to be good designed in much cases.</p>
<p>This doesn&#8217;t mean you should put all methods to public scope! Test cases should be in the same package as their Test classes are, so you can try to work with package scoped methods aswell. However, whatever you do, testable code is good, but it never should break encapsulation just for beeing testable.</p>
<p>In most cases private methods can be tested with the test of public methods. Test coverage tools help to identify test lacks.</p>
<h2>What to test? Again!</h2>
<p>Try to test all public methods! If you need to create files, use the tempfolder. Set up databases for the test. Use Jetty and HSQL if need it embedded &#8211; in PHP its PDO and SQLite. Don&#8217;t waste your time with testing exceptions which usually never happen. Just use 20% of your time to make 80% of tests! Try to test business logic &#8211; if that means the creation of complex objects, so be it. Maybe you can share the logic. But don&#8217;t get bored with testing getter and setters. Those are called thousand of times within normal tests or procedures, no need to do that.</p>
<h2>How much time can test development need??</h2>
<p>Calculate the same time as implemeting the testcase. Too much? Not really! Imagine you are writing business code for 5 hours. Thousands of outputs on the console you read manually. You delete it, check it in and later want to fix again. Put those outputs in again? Have commented it out? Code is ugly? Put all your stuff in a testcase. Nobody claims if you need 5 hours for it, if its done properly. Sometimes testcases need 3 days but the fix just 1 hour. This can happen in EAI enviroments, where multiple systems communicate. No problem here &#8211; these is business critical, automatic tests are the best you can do.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/05/27/some-words-about-unit-testing-junit-phpunit.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Commons Compress 1.0 released!</title>
		<link>http://www.grobmeier.de/2009/05/22/apache-commons-compress-10-released.html</link>
		<comments>http://www.grobmeier.de/2009/05/22/apache-commons-compress-10-released.html#comments</comments>
		<pubDate>Thu, 21 May 2009 22:27:30 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Commons Compress]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=222</guid>
		<description><![CDATA[Commons Compress 1.0 released!]]></description>
			<content:encoded><![CDATA[<p>The Commons Compress team is pleased to announce the commons-compress-1.0 release!</p>
<p>Commons Compress is a component that contains Ar, Cpio, Jar, Tar, Zip and BZip2 packages</p>
<p>Source and binary distributions are available for download from the Apache Commons download site:</p>
<p><a href="http://commons.apache.org/compress/download_compress.cgi">http://commons.apache.org/compress/download_compress.cgi<br />
</a><br />
When downloading, please verify signatures using the KEYS file available at the above location when downloading the release.</p>
<p>For more information on Apache Commons Compress, visit the Commons Compress home page:</p>
<p><a href="http://commons.apache.org/compress/ ">http://commons.apache.org/compress/ </a></p>
<p>Changes in this version include:</p>
<p>New features:<br />
o Initial release</p>
<p>Have fun!<br />
-Commons Compress team</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/05/22/apache-commons-compress-10-released.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Singleton issue &#8211; an everlasting discussion</title>
		<link>http://www.grobmeier.de/2009/05/01/the-singleton-issue-an-everlasting-discussion.html</link>
		<comments>http://www.grobmeier.de/2009/05/01/the-singleton-issue-an-everlasting-discussion.html#comments</comments>
		<pubDate>Thu, 30 Apr 2009 22:01:38 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=208</guid>
		<description><![CDATA[Drawbacks and Benefits of the Singleton Pattern. How to implement it in PHP and in Java.]]></description>
			<content:encoded><![CDATA[<p>Today it looks that everybody needs an very extreme opinion in each technical topic. I mean, Windows is evil, OS X too, but Linux is uncomfortable and Unix is dead. JavaScript is just a toy, without JavaScript you don&#8217;t have a professional website. Java is slowest, Java is coolest and so on and so on. Finally: Singletons are evil. By the way, sometimes several people say that using design patterns destroy the ability of thinking yourself.</p>
<p>In fact, I strongly believe that every concept (ok, most <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) have benefits and drawbacks. The case of the singleton for me is easy: it depends.</p>
<p>So what&#8217;s wrong with that pattern?</p>
<p>Some people claim that the Singleton pattern is a sign of bad software design. They say the Singleton can be used as some kind of global variable. Well, that&#8217;s true, sometimes. But the Singleton can be used otherwise than a global variable holder. Actually you have to differ between your programming language before thinking about a good or bad usage of the Singleton Pattern.</p>
<h2>How to implement the Singleton pattern in PHP</h2>
<p>PHP is a scripting language, it&#8217;s actions are performed by an interpreter. It doesn&#8217;t support multiple threads like Java or Ruby does. This is very important later. But first, lets create a singleton in PHP.</p>
<pre>class MySingleton {</pre>
<pre>    private static $instance;</pre>
<pre>    private function __construct() {}</pre>
<pre>    public static function getInstance() {</pre>
<pre>        if(self::instance == null) {</pre>
<pre>            self::instance = new MySingleton();</pre>
<pre>        }</pre>
<pre>        return self::instance;</pre>
<pre>    }</pre>
<pre>}</pre>
<p>How does this work? You create a static variable in a class. If one calls getInstance() for the first time, a new object is created and stored in the static variable. If you call the method again, you&#8217;ll get exactly the same instance you created with the first call. This object &#8211; since it is static &#8211; will stay until your script has ended and the complete request is processed. You see, why the singleton has it&#8217;s name. It&#8217;s only one object created and used for all the time.</p>
<p>And to keep this behaviour, you just have to put your constructor private &#8211; nobody else than your getInstance method should be allowed to create this object.</p>
<h2>How to implement a Singleton with Java</h2>
<p>Now you have to think about some more issues. Since Java supports multithreading you have to think about more than just creating the object and returning it. First, we&#8217;ll see how a pure PHP programmer would create the singleton with Java syntax.</p>
<pre>public class MySingleton {</pre>
<pre>    private static MySingleton instance;</pre>
<pre>    // Again - just MySingleton is allowed to construct this object</pre>
<pre>    private MySingleton() {}</pre>
<pre>    public static getInstance() {</pre>
<pre>        if(instance == null) {</pre>
<pre>            instance = new MySingleton();</pre>
<pre>        }</pre>
<pre>        return instance;</pre>
<pre>    }</pre>
<pre>}</pre>
<p>OK, now think about two threads which call getInstance() at the same time, and imagine nobody has done so before. Both threads would enter getInstance(). Chances are good that Java helps you even with multiple processors (it should do, cause Suns Sales Managers sell Java as a simple to use language <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ). In that case, one thread would go on to create the MySingleton object, while the other one will jump over it and return the instance.</p>
<p>You have to ask the question, does this really work? Cause at which point of time is instance not longer null? The answer is, if you create the object headers, the instance variable is not longer null. That means, that a second thread could overtake thread one and work on an instance which is not really created (just the have of it)! Something unexpected will occure and even if your customer will claim about an error, you probably will never have the chance to find it.</p>
<p>So what now? We have to make sure that:</p>
<p>a) two threads are not creating a MySingleton object at the same time<br />
b) one thread doesn&#8217;t work on the object while it is still under construction</p>
<p>Some programmers start something like this:</p>
<pre>public class MySingleton {</pre>
<pre>    private static MySingleton instance;</pre>
<pre>    public static getInstance() {</pre>
<pre>        if(instance == null) {</pre>
<pre>            synchronized(this) {</pre>
<pre>                if(instance == null) {</pre>
<pre>                    instance = new MySingleton();</pre>
<pre>                }</pre>
<pre>            }</pre>
<pre>        }</pre>
<pre>        return instance;</pre>
<pre>    }</pre>
<pre>}</pre>
<p>Please note the synchronized block above. It keeps care that only one thread can execute the code for creation at one time.</p>
<p>Is this the solution? No. Even in that case it can happen that Thread 1 locks everything correctly for creating the object. But if Thread 2 comes at a bad time, it will ask the outer instance == null check and again it could return an unfinished object. The synchronized block just helps with one problem.</p>
<p>Actually there is only one 100% solution. Create the necessary object while class loading.</p>
<pre>public class MySingleton {</pre>
<pre>    private static MySingleton instance = new MySingleton();</pre>
<pre>    public static getInstance() {</pre>
<pre>        return instance;</pre>
<pre>    }</pre>
<pre>}</pre>
<p>This is a solution PHP programmers cannot have since PHP doesn&#8217;t support to create objects like this. But for the Java programmer it&#8217;s the only way to make object creation work. And yes, sometimes it&#8217;s not possible to go this way. But that&#8217;s another story.</p>
<h2>Singleton Lifetime</h2>
<p>You should know about another difference between Java and PHP Singletons. In Java, the static keywords makes the variable available at a class level, not at object level. This means it follows you as long as the JVM is alive &#8211; from programm start to programm end, and in case of an enterprise or an eai server, this can take a long, long time.</p>
<p>For a PHP programm it&#8217;s the same &#8211; from programm start to programm end. But in PHP words this means the time when an HTTP request arrives and script execution begins till the end of the script has been reached. After a request, the singleton is gone, dead, and you&#8217;ll have to create it again, with the next request.</p>
<p>In human words, this means that a Java singleton probably lives for days, weeks or even months and the PHP singleton just for less milliseconds.</p>
<h2>The Benefits of Singleton</h2>
<p>Well, benefit is: you have to create only one object of an class and can use it over and over again. This is cool, since creating an object takes usually a long time in the interpreter or in the virtual machine. Cause of this, old programmers often say object orientation is slow. Meanwhile everything is faster and in most cases you don&#8217;t have to care bout this anymore.<br />
And this is where critic starts: people say, you could misuse the Singleton as some kind of global variable store. This comes often from PHP programmers, who think about that code:</p>
<pre>class MySingleton {</pre>
<pre>    ...</pre>
<pre>    public $bla = "blubber";</pre>
<pre>    public static function getInstance() {</pre>
<pre>        ...</pre>
<pre>    }</pre>
<pre>}</pre>
<p>In this case, you can have the variable $bla available all over your code. Just do a:</p>
<pre>MySingleton::getInstance()-&gt;$bla;</pre>
<p>Is this good? No. Of course not. If you just want to store something, go ahead, use $GLOBALS or a similar global available variable. Same goes to Java. There are no global fields, but you can create some similar with System properties.</p>
<p>But Singleton will have more the worth if the singleton object has some methods you can operate on. Imagine that singleton object trys to reload a configuration.</p>
<pre>class MySingleton {</pre>
<pre>    ...</pre>
<pre>    public $bla = "blubber";</pre>
<pre>    public function loadConfiguration() {</pre>
<pre>        // code to load xml file</pre>
<pre>        $this-&gt;bla = getValueFromXML();</pre>
<pre>    }</pre>
<pre>    ...</pre>
<pre>}</pre>
<p>This would make it possible to reload the config at runtime. Even date formatting etc. would be possible at runtime.</p>
<p>Basically said, an object which provides methods is worth something. It&#8217;s not to bad to do so. But a more cool benefit is if you have a stateless singleton.</p>
<pre>class MySingleton {</pre>
<pre>    ...</pre>
<pre>    public function doSomething($bla) {</pre>
<pre>        $bla = $bla / 2;</pre>
<pre>        return $bla;</pre>
<pre>    }</pre>
<pre>    ...</pre>
<pre>}</pre>
<p>Imagine doSomething() does some complex things with $bla. You don&#8217;t need to store the result in the MySingleton object. It will returned. Since there are no object variables available, this object is stateless. And there is really no need to create multiple objects just to perform some operations on $bla.</p>
<p>But why should one consider to create an object if he can do this in a static way, you ask. Static access to methods is not very flexible. Think on AOP, where objects wrap other objects and prevent you from calling a method directly. This wouldn&#8217;t work. That&#8217;s just one example. There are others: maybe you want to choose at runtime, which implementation you use to create this task. In a static context you would have to change your implementation, in an object context you could use a factory and a strategy pattern to switch. This is way more flexible.</p>
<h2>Drawbacks of the Singleton pattern</h2>
<p>Yes, of course there are several. Think on the global variable thing. It&#8217;s true, imagine you have one thousand of Singletons, all keeping care of their own little states, read within the application from a million of places. Not very good. Esspecially with PHP you cannot easily find out where those variables are called. In Java you have some good shortcuts in your IDE.</p>
<p>But we know now, that a Singleton is meant for reducing object creation time and not for state sharing. Next drawback is more significant, since the first one is a mistake just inexperienced programmers do.</p>
<p>Problem is, if you create a Singleton it will stay one forever. If you need to make multiple objects of your class, you have to write code for this. In small projects this is not such a big issue, but in a 100.000 lines of code project it is. There are other patterns like Prototype or Factory which could be useful suddenly and we would have to write code. This is a risk.</p>
<p>The solution is to create this Singleton not by code like we did above. Use a framework for creating your objects. In PHP you PIWI and the BeanFactory at your side, which helps you with constructing singletons (and injects the objects in other objects &#8211; Dependency Injection, see the previous article).<br />
In Java you can use Spring for this. Spring is the big inspiration source for PIWI (regarding object creation and dependency injection) and widely used. Besides Spring there is Google Guice and PicoContainer too, which provide similar stuff.</p>
<h2>Finally</h2>
<p>There is no need to say Singleton is good or bad. It&#8217;s neither. It&#8217;s just a pattern. A Singleton is just as evil as you misuse it, and just as glorious as you identify it as fitting pattern to a specific problem.</p>
<p>In my projects I use a Singletons sometimes for configuration. I don&#8217;t think it&#8217;s bad behaviour. If I don&#8217;t have one thousand of this object in my System, it&#8217;s OK. More often Singletons are used as some kind of worker classes, just here for doing complex stuff with storing a state. They help me not to waste memory. And due Singletons are objects I easily can extends them via aspect oriented programming &#8211; perfect!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/05/01/the-singleton-issue-an-everlasting-discussion.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dependency Injection &#8211; a Design Pattern</title>
		<link>http://www.grobmeier.de/2009/04/16/dependency-injection-a-design-pattern.html</link>
		<comments>http://www.grobmeier.de/2009/04/16/dependency-injection-a-design-pattern.html#comments</comments>
		<pubDate>Thu, 16 Apr 2009 10:49:50 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PIWI]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=196</guid>
		<description><![CDATA[What is the dependency injection design pattern? Here are examples in PHP. Explained on PIWI and Spring Framework.]]></description>
			<content:encoded><![CDATA[<p>Design Patterns are useful and a must have. Everybody working seriously on software projects should know about them. End of 2007 I decided to use the powerful Spring Framework at my new enterprise project.  The project, which ended these days for me, was a huge success. We made complex changes easy, had very good unit testing and all that stuff. We had up to 12 developers working on the code, I am really thinking that Spring did lots for our success. It was so easy to seperate all the modules and integrate new features within minutes. I am writing this in my article about Dependency Injection, cause Spring highly depends on this design pattern and PIWI will do that, too.</p>
<h2>Design Patterns &#8211; all just theory?</h2>
<p>If students make their exams and come as junior programmers to my projects, they often believe a design pattern is something to eat. Or something theoretical. Or simply a joke. I usually start with explaining how to use it and such, but at the first glance it seems to abstract to them. Later, with the expierence, comes the joy.</p>
<p>This is true for patterns like Singleton or Factory or maybe Model-View-Controller. Coming to Dependency Injection &#8211; which is not read very often in Books about good software design &#8211; most people NEVER have joy. In this kind it behaves like the Proxy pattern. One really cannot use this out of the box. I mean, a singleton can be implemented within minutes, and it does what it does. But Dependency Injection? It&#8217;s more a concept of software design than a design pattern. Can you implement a singleton? Yes. Can you implement Dependency Injection? No, of course not. Having that said, the joy and the power comes when you are using a fitting framework which supports the design pattern. Like Spring. Or PIWI, in the latest trunk version. Cause we PIWI-folks simply have stolen much of the ideas of Spring and now use it not only in Java, but in PHP5 too.</p>
<h2>What&#8217;s all about it?</h2>
<p>Basically Dependency Injection simply says: don&#8217;t make a class dependent from another, inject the dependency. So what? some will say. But it&#8217;s simple. Imagine the following PHP lines:</p>
<pre>class Car {
   private $driver = null;

   public crash() {
      $this-&gt;driver-&gt;saySomething();
   }
}</pre>
<p>You see, there is a private member called driver in the car class. If your use case is that each car is a driver, it&#8217;s quite easy in most cases. Just fill the member in the constructor. This is, what most people do. This makes $driver nullsafe.</p>
<pre>class Car {
   private $driver = null;

   public __construct() {
      $this-&gt;driver = new Driver();
   }

   public crash() {
      $this-&gt;driver-&gt;saySomething();
   }
}</pre>
<p>OK. From this point on the class Car depends on the class Driver, cause you need the Driver class to instanciate Car. After you did that and all works well, your boss looks round the corner and tells you that we need to distinguish between female drivers and male drivers. He is sorry for saying that so late, but it&#8217;s like this. Cause if you call the new method crash(), a female driver would simply say:&#8221;you crashed me!&#8221; and a male driver would say something like:&#8221;guy i have a gun!&#8221;. And, that&#8217;s the point, your client A just wants male drivers in their systems, while client B just needs female drivers.</p>
<p>People start doing:</p>
<pre>class Car {
   private $driver = null;

   public __construct($client) {
      if($client == "A") {
         $this-&gt;driver = new MaleDriver();
      } else if($client == "B") {
         $this-&gt;driver = new FemaleDriver();
      }
}

   public crash() {
      $this-&gt;driver-&gt;saySomething();
   }
}</pre>
<p>All is good. But what if you need to port the system for somebody who just let childs drive? Or people with glasses upon their noses? In fact, we had the requirement to create several modules for several clients &#8211; customization. Yes, the example above with male and female drivers is not the best, but I am sitting in a car while typing this.</p>
<p>Problem on the approach above is that you need a new if else if you ever have more Driver types than above. And you have to put this in class where such dependencies exist. Maybe it&#8217;s not pretty much, but in our case we had about 20 modules &#8211; without customizations. I really was afraid before such a switch.</p>
<h2>Dependency Injection for the solution</h2>
<p>As I allready told you, we had Spring and Java 6 in our system. But we ported dependency injection to PIWI. And if you are using one of these frameworks, you know that both heavily use XML. Imagine you could say in an XML which driver you want to use. More better: you really would define an interface for all the driver classes and would make sure that you operate on that interface only.</p>
<p>See this:</p>
<pre>interface Driver {
   public saySomething();
}

class FemaleDriver implements Driver {
   public saySomething() {
      echo "You crashed me!";
   }
}</pre>
<p>(imagine something similar for MaleDriver).</p>
<p>You could do something like that:</p>
<pre>class Car {
   private $driver = null;

   public __construct($driver) {
      $this-&gt;driver = $driver;
   }

   public crash() {
      $this-&gt;driver-&gt;saySomething();
   }
}</pre>
<p>Isn&#8217;t your code much cleaner now? You know, if else means death to object orientation! This way your Car class doesn&#8217;t depend to MaleDriver or FemaleDriver. In case of PHP5 it just depends on an untyped object. In case of Java it depends on the Interface Driver.</p>
<p>By the way: you can force types in PHP5 (in some level of course). You could write the constructor like this:</p>
<pre>public __construct(Driver $driver) {
   $this-&gt;driver = $driver;
}</pre>
<p>This forces the caller to put an object inside which implements the interface Driver. And this in fact is the way you should go! And this is all about the Dependency Injection pattern. It says, make your classes dependend on interfaces, not on classes.</p>
<p>So, isn&#8217;t it nice? But how do you decide to bring your dependency in? This is another point, and this is why I said you have to check out Spring or PIWI for this. The example above is working gorgeous, but if you don&#8217;t find a mechanism to bring your dependencies into the game, all is lost. I promised XML like Spring does, and here it is: PIWIs XML file for Dependency Injection in PHP.</p>
<pre>&lt;bean id="xmlPage" class="XMLPage" scope="request"&gt;
   &lt;property name="contentPath" php="$GLOBALS['PIWI_ROOT'].CONTENT_PATH" /&gt;
   &lt;property name="siteFilename" value="site.xml" /&gt;
&lt;/bean&gt;

&lt;bean id="siteSelector" class="SiteSelector" scope="request"&gt;
   &lt;property name="page" ref="xmlPage" /&gt;
&lt;/bean&gt;</pre>
<p>We call our objects beans, like Spring does. It&#8217;s Spring-Beans in Spring, but PIWI-Beans in PIWI. We are shameless. First, look at the bean definition with the id xmlPage. You give it a class and a scope, and some properties.</p>
<p>Basically, PIWI (and Spring too) creates the objects for you. That has many benefits. I will write an blog article why instanciating objects yourself is sometimes a bad idea some day. However, PIWI makes an object and stores it in our context, the BeanFactory. It&#8217;s stored under the id xmlPage, and you can get the object manually if you call:</p>
<pre>$xmlPage = BeanFactory::getBeanById('xmlPage');</pre>
<p>This brings you the ready bean. Additionally you tell the BeanFactory that it should set the property &#8220;siteFilename&#8221; to &#8220;site.xml&#8221;. And one line above you even give it an PHP expression. After PIWi made the object from the class XMLPage, it checks if a member variable is accessible named siteFilename. If it isn&#8217;t it looks if there is a method called setSiteFilename($o); or siteFileName($o). If PIWI found that method, it calls it with the value.</p>
<p>This is all done by reflection, which has been shipped with PHP5. No dependencies to other libs, no problem. Just plain PHP5. Same goes to Java. Plain Java. No Magic. Just some reflection.</p>
<p>If you would have called this line instead of the one above:</p>
<pre>$siteSelector = BeanFactory::getBeanById('siteSelector');</pre>
<p>the BeanFactory would have created the siteSelector bean. If you look into it, you see this:</p>
<pre>&lt;property name="page" ref="xmlPage" /&gt;</pre>
<p>If the BeanFactory gets aware of this (and it does!), it will look in the context for a PIWI Bean with the ID xmlPage. If there isn&#8217;t one, it will try to create such a bean. Same rules as above. After creation of xmlPage it will be set into SiteSelector&#8217;s setPage($xmlPage) method.</p>
<p>And now imagine how your boss would love it, if you tell him that such a customization is just a matter of some XML?</p>
<pre>&lt;bean id="maleDriver" class="MaleDriver" scope="request" /&gt;
&lt;bean id="femaleDriver" class="FemaleDriver" scope="request" /&gt;

&lt;bean id="car" class="Car" scope="request"&gt;
   &lt;property name="driver" ref="maleDriver" /&gt;
&lt;/bean&gt;</pre>
<p>Everthing done!</p>
<p>For the sake of completness &#8211; what do we mean with scope? Well, scope is in which scope your object lives. Defining request means, the we create maleDriver only once while the whole request. If you define another class which needs maleDriver, it would get &#8211; exactly the same -. This is, what some people call a Singleton in PHP. But Singletons are worth an own Blog entry, since some people &#8211; esspecially who have just written code with PHP and not for Java Enterprise Systems &#8211; say, Singletons are evil. Well, they are not. If developers are not thinking while coding, that is evil <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  You can misuse everything, if you want to.</p>
<p>Here is another example for using the driver more than once:</p>
<pre>&lt;bean id="maleDriver" class="MaleDriver" scope="request" /&gt;
&lt;bean id="femaleDriver" class="FemaleDriver" scope="request" /&gt;

&lt;bean id="car" class="Car" scope="request"&gt;
   &lt;property name="driver" ref="maleDriver" /&gt;
&lt;/bean&gt;

&lt;bean id="truck" class="Truck" scope="request"&gt;
   &lt;property name="driver" ref="maleDriver" /&gt;
&lt;/bean&gt;</pre>
<p>In this case, only the same instance of maleDriver makes it to the truck and to the car. Decide yourself if this is your usecase. In the MaleDriver class are no states defined &#8211; so one object is enough.</p>
<p>OK &#8211; Dependencies are out. Instanciation is out of the code too. But is this the whole benefit? Not really. This stuff makes it possible to create dynamic proxies and use aspect orientation, even with PHP. And be sure, PIWI will have features some day. And Spring still got this cool stuff. But that&#8217;s another story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/04/16/dependency-injection-a-design-pattern.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JJSon: Bugfix release out and new stuff in trunk</title>
		<link>http://www.grobmeier.de/2009/04/02/jjson-bugfix-release-out-and-new-stuff-in-trunk.html</link>
		<comments>http://www.grobmeier.de/2009/04/02/jjson-bugfix-release-out-and-new-stuff-in-trunk.html#comments</comments>
		<pubDate>Thu, 02 Apr 2009 06:04:57 +0000</pubDate>
		<dc:creator>Christian Grobmeier</dc:creator>
				<category><![CDATA[JJSon]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.grobmeier.de/?p=163</guid>
		<description><![CDATA[JJSon has become new features and a bugfix release.]]></description>
			<content:encoded><![CDATA[<p>This early morning I uploaded a new JJSon version (0.0.3). It resolves the first and only issue with the lib: unfortunatly I created the jar with Java 6 bytecode. Well, my newly created POM file will prevent me for errors like this in future. From nowon JJSon is a Maven 2 project. Get the new jar at <a href="http://jjson.googlecode.com/" target="_blank">JJSon&#8217;s Googlecode page</a>.</p>
<p>Motivated by the 100 downloads I started to create the Annotation encoder yesterday night. Its very basic and doesn&#8217;t contain good testcases at the moment, but at first glance it works <img src='http://www.grobmeier.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You can serialize Java Objects into a JSon string with that stuff. Supported are the usual json types, except double (sorry, forgot that). List and Maps can be serialized too, aswell as annotated pojos.</p>
<p>I will add the double and some more testcases in future, then try to aim to the next release. Additionally I want to release a zip file next time, containing license stuff and maybe some docs. If you are willing to help, shout!</p>
<p>Background info:</p>
<p>JJSon is a small API for working with the Json format. There are several libs out there, but I don&#8217;t know any which are well encoded AND have no dependencies. JJSon doesn&#8217;t provide all features the other libs have, but aims to be easily extendable and definitly comes without any necessary dependencies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grobmeier.de/2009/04/02/jjson-bugfix-release-out-and-new-stuff-in-trunk.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
