<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nino Martinez's Weblog</title>
	<atom:link href="http://ninomartinez.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ninomartinez.wordpress.com</link>
	<description>TechBlog about Wicket, Persistence, IOC and Java</description>
	<lastBuildDate>Fri, 11 Nov 2011 06:42:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ninomartinez.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nino Martinez's Weblog</title>
		<link>http://ninomartinez.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ninomartinez.wordpress.com/osd.xml" title="Nino Martinez&#039;s Weblog" />
	<atom:link rel='hub' href='http://ninomartinez.wordpress.com/?pushpress=hub'/>
		<item>
		<title>mvn 3.0.3 + java 7 Datasource fail</title>
		<link>http://ninomartinez.wordpress.com/2011/11/11/mvn-3-0-3-java-7-datasource-fail/</link>
		<comments>http://ninomartinez.wordpress.com/2011/11/11/mvn-3-0-3-java-7-datasource-fail/#comments</comments>
		<pubDate>Fri, 11 Nov 2011 06:37:28 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=283</guid>
		<description><![CDATA[Okay just wanted to mention that if you&#8217;ve done a custom Datasource for java 6 and try to compile it with java 7 on maven using backwards compability you get this: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on pr oject wallboard-cisco-drivers: Compilation failure [ERROR] \nino\develop\eclipseworkspace\projects\internalcomponents\Applications\wallboard\trunk\wallboard-cisco-dri vers\src\main\java\com\netdesign\dao\cisco\general\DataSourceProvider.java:[149,43] error: is not abstract and does not override [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=283&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Okay just wanted to mention that if you&#8217;ve done a custom Datasource for java 6 and try to compile it with java 7 on maven using backwards compability you get this:</p>
<p><code><br />
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on pr<br />
oject wallboard-cisco-drivers: Compilation failure<br />
[ERROR] \nino\develop\eclipseworkspace\projects\internalcomponents\Applications\wallboard\trunk\wallboard-cisco-dri<br />
vers\src\main\java\com\netdesign\dao\cisco\general\DataSourceProvider.java:[149,43] error: is not abstract and does not override abstract method getParentLogger() in<br />
CommonDataSource<br />
[ERROR] -&gt; [Help 1]<br />
[ERROR]<br />
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.<br />
[ERROR] Re-run Maven using the -X switch to enable full debug logging.<br />
[ERROR]<br />
[ERROR] For more information about the errors and possible solutions, please read the following articles:<br />
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException<br />
[ERROR]<br />
[ERROR] After correcting the problems, you can resume the build with the command<br />
[ERROR] mvn -rf :wallboard-cisco-drivers<br />
C:\nino\develop\eclipseworkspace\projects\internalcomponents\Applications\wallboard\trunk&gt;<br />
</code></p>
<p>Please notice that i&#8217;ve specified this in my pom:<br />
<code></p>
<p>&lt;plugin&gt;<br />
&lt;inherited&gt;true&lt;/inherited&gt;<br />
&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;<br />
&lt;version&gt;2.3.2&lt;/version&gt;<br />
&lt;configuration&gt;<br />
&lt;source&gt;1.6&lt;/source&gt;<br />
&lt;target&gt;1.6&lt;/target&gt;<br />
&lt;/configuration&gt;<br />
&lt;/plugin&gt;<br />
</code><br />
Only solution are to grab an old jdk 6 and compile it with that.. I was using jdk 1.7.0.</p>
<p>Feel free to correct me if im wrong somehow.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/283/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/283/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/283/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=283&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2011/11/11/mvn-3-0-3-java-7-datasource-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Guice and JDBC #2</title>
		<link>http://ninomartinez.wordpress.com/2011/11/04/guice-and-jdbc-2/</link>
		<comments>http://ninomartinez.wordpress.com/2011/11/04/guice-and-jdbc-2/#comments</comments>
		<pubDate>Fri, 04 Nov 2011 07:55:01 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=278</guid>
		<description><![CDATA[So a little while ago, I wrote about jdbc and guice.. I&#8217;ve been using mybatis since then.. And it just came to me yesterday &#8220;with mybatis you can do simple jdbc with guice&#8221;. Something similar to Spring JDBC templates. So heres how (integer select), using annotation approach in something called a mapper class. @Select(value = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=278&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So a little while ago, I wrote about jdbc and guice.. I&#8217;ve been using mybatis since then.. And it just came to me yesterday &#8220;with mybatis you can do simple jdbc with guice&#8221;. Something similar to Spring JDBC templates.</p>
<p>So heres how (integer select), using annotation approach in something called a mapper class.</p>
<p><code><br />
	@Select(value = "select ${sql}")<br />
	public Integer updateCustomerEntrance(@Param("sql") String sql);</p>
<p></code></p>
<p>Thats it the only stuff you need to ensure are that your select will return an integer, and thats it. Mybatis will manage connection pool, connection etc for you.</p>
<p>It&#8217;s probably also possible for you to just return a object.. you&#8217;ll need at least  3 methods one for each type of sql, select update and delete. </p>
<p>However this approach are not at all utilizing mybatis&#8217;s power and are prone to SQL injection.. But it will do the job, and you can then go ahead an convert your legacy code slowly to use mybatis&#8217;s full potential.</p>
<p>Heres howto setup guice using it:</p>
<p>http://code.google.com/p/mybatis/wiki/Guice</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=278&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2011/11/04/guice-and-jdbc-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Connecting to db_cra uccx 8</title>
		<link>http://ninomartinez.wordpress.com/2010/06/03/connecting-to-db_cra-uccx-8/</link>
		<comments>http://ninomartinez.wordpress.com/2010/06/03/connecting-to-db_cra-uccx-8/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 08:20:23 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cisco]]></category>
		<category><![CDATA[db_cra]]></category>
		<category><![CDATA[uccx8]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=268</guid>
		<description><![CDATA[So im trying to connect to db_cra on a uccx 8, and it turned out to be a litte harder than expectet. In the cisco documentation the Informix database should be called something like hostname_uccx. In our case our servers are named SERVERNAME-number so the informix name should be SERVERNAME-number_uccx, thats not the case. Heres [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=268&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So im trying to connect to db_cra on a uccx 8, and it turned out to be a litte harder than expectet. In the cisco documentation the Informix database should be called something like hostname_uccx. In our case our servers are named SERVERNAME-number so the informix name should be SERVERNAME-number_uccx, thats not the case.</p>
<p>Heres the recipe:  </p>
<p>Find the real name of the informix server: run this on your uccx CLI:<br />
<pre class="brush: plain;">
file dump inactivelog /uccx/log/db/uccx_repl_output_util.log
</pre><br />
Go to the last page using SPACE and look for something like this:<br />
<pre class="brush: plain; highlight: [4];">
2010-05-14 22:00:23,242 - uccxdb.util - DEBUG - getservers processing
2010-05-14 22:00:23,244 - uccxdb.util - DEBUG - getservers: processing line g_poc5_uccx8_uccx group           -               -               i=1
2010-05-14 22:00:23,244 - uccxdb.util - DEBUG - getservers: processing line poc5_uccx8_uccx onsoctcp POC5-UCCX8 poc5_uccx8_uccx g=g_poc5_uccx8_uccx b=32767
2010-05-14 22:00:23,245 - uccxdb.util - DEBUG - The servers are [['poc5_uccx8_uccx'], ['g_poc5_uccx8_uccx']]
2010-05-14 22:00:23,453 - uccxdb.util - DEBUG - Setting property com.cisco.callprocessing.protocolID to CTI-JTAPI on poc5_uccx8_uccx
</pre></p>
<p>And that&#8217;s it. So in our case our server got lower cased and underscored, &#8220;poc5_uccx8_uccx&#8221;.</p>
<p>If you want you can use the ibm JDBC driver (http://www14.software.ibm.com/webapp/download/search.jsp?go=y&amp;rs=ifxjdbc) and the SQL squirrel (http://squirrel-sql.sourceforge.net/)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=268&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2010/06/03/connecting-to-db_cra-uccx-8/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Guice Caching And Interceptors</title>
		<link>http://ninomartinez.wordpress.com/2010/05/14/guice-caching-interceptors/</link>
		<comments>http://ninomartinez.wordpress.com/2010/05/14/guice-caching-interceptors/#comments</comments>
		<pubDate>Fri, 14 May 2010 17:30:06 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=245</guid>
		<description><![CDATA[A little while ago I wanted to try out Guice 2&#8242;s Interceptors. And amazingly enough, I managed to create an integration towards ehcache in a couple of hours and had fun too. The result is this And bind it in your module So what&#8217;s backing those annotations in line 19 and 28 of the first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=245&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A little while ago I wanted to try out Guice 2&#8242;s Interceptors. And amazingly enough, I managed to create an integration towards ehcache in a couple of hours and had fun too.</p>
<p>The result is this</p>
<p><pre class="brush: java; highlight: [19,28];">
// Calculator.java
package org.slurry.cache4guice;

public interface Calculator {

        public int calculateSomethingWild(Integer number) throws InterruptedException ;

        public int calculateSomethingWild(Integer number,Integer number2) throws InterruptedException ;

}

// CalculatorImpl.java
package org.slurry.cache4guice;

import org.slurry.cache4guice.annotation.Cached;

public class CalculatorImpl implements Calculator {

        @Cached
        public int calculateSomethingWild(Integer number)
                        throws InterruptedException {
                Thread.sleep(2000);

                return number;

        }

        @Cached
        public int calculateSomethingWild(Integer number, Integer number2)
                        throws InterruptedException {
                Thread.sleep(2000);

                return number + number2;
        }

}
</pre></p>
<p>And bind it in your module</p>
<p><pre class="brush: java;">
// GuiceModule.java
package org.slurry.cache4guice;

import com.google.inject.AbstractModule;

public class GuiceModule extends AbstractModule {

        @Override
        protected void configure() {
                bind(Calculator.class).to(CalculatorImpl.class);

        }

}

</pre></p>
<p>So what&#8217;s backing those annotations in line 19 and 28 of the first source code box, whats doing all the magic?<br />
1. An annotation, dada <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><pre class="brush: java;">
package org.slurry.cache4guice.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD)
public @interface Cached {

}
</pre></p>
<p>2. An interceptor, more interesting, look at line 18 the most important thing in the interceptor implementation</p>
<p><pre class="brush: java; highlight: [18];">
package org.slurry.cache4guice.aop;

import net.sf.ehcache.Cache;
import net.sf.ehcache.CacheManager;
import net.sf.ehcache.Element;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import com.google.inject.Inject;

public class CacheInterceptor implements MethodInterceptor {

        private CacheManager cacheManager;

        private CacheKeyGenerator cacheKeyGenerator;

        public Object invoke(MethodInvocation invocation) throws Throwable {
                setupCacheIfNecessary(invocation);

                return getResultFromCacheOrMethod(invocation);

        }

...
</pre></p>
<p>3. Some Guice setup, in a module look at line 18,19 and 20. And actually line 19 are only needed if you need something injected into your interceptor</p>
<p><pre class="brush: java; highlight: [18,19,20];">
package org.slurry.cache4guice.module;

import net.sf.ehcache.CacheManager;

import org.slurry.cache4guice.annotation.Cached;
import org.slurry.cache4guice.aop.CacheInterceptor;
import org.slurry.cache4guice.aop.CacheKeyGenerator;
import org.slurry.cache4guice.cache.StringBasedKeyGenerator;

import com.google.inject.AbstractModule;
import com.google.inject.matcher.Matchers;

public class CacheModule extends AbstractModule {
        protected void configure() {

                bind(CacheManager.class).toInstance(CacheManager.create());
                bind(CacheKeyGenerator.class).to(getCacheKeyGeneratorClass());
                CacheInterceptor cacheInterceptor = new CacheInterceptor();
                requestInjection(cacheInterceptor);
                bindInterceptor(Matchers.any(), Matchers.annotatedWith(Cached.class),
                                cacheInterceptor);
        }

        protected Class getCacheKeyGeneratorClass() {

                return StringBasedKeyGenerator.class;
        }
}

</pre></p>
<p>So could it be easier? I mean theres only 3 steps. Now I haven&#8217;t shown all the code, only the relevant ones for guice. There&#8217;s a little more to it. And I should probably expand the functionality, so there&#8217;s a evict from cache annotation, that can evict certain caches. So did you need a cache for guice or did you want to play with interceptors, now you got both <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>All hosted here, with source code and tests,  if you have additions please  contribute</p>
<p>http://code.google.com/p/slurry/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=245&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2010/05/14/guice-caching-interceptors/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>GeeCon_2010</title>
		<link>http://ninomartinez.wordpress.com/2010/05/14/geecon_2010/</link>
		<comments>http://ninomartinez.wordpress.com/2010/05/14/geecon_2010/#comments</comments>
		<pubDate>Fri, 14 May 2010 16:52:08 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=243</guid>
		<description><![CDATA[So sitting in the hotel, geecon 2010 are over. All in all a nice experience. A little small maybe. But content was great, thats the important thing. And if you look at the price, if probably the best conference for the price, 100 eur&#8230; Cant get much cheaper. The website http://2010.geecon.org/main/home And the slides/videos (some, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=243&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So sitting in the hotel, geecon 2010 are over. All in all a nice experience. A little small maybe. But content was great, thats the important thing. And if you look at the price, if probably the best conference for the price, 100 eur&#8230; Cant get much cheaper.</p>
<p>The website</p>
<p>http://2010.geecon.org/main/home</p>
<p>And the slides/videos (some, I guess they&#8217;ll all come latter) :</p>
<p>http://www.parleys.com/#st=4&#038;id=51713</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/243/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/243/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/243/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=243&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2010/05/14/geecon_2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Guice JDBC and Pools</title>
		<link>http://ninomartinez.wordpress.com/2010/03/12/guice-jdbc/</link>
		<comments>http://ninomartinez.wordpress.com/2010/03/12/guice-jdbc/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 10:24:47 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=238</guid>
		<description><![CDATA[These last days I&#8217;ve been working on a Rest application  which provides a generic interface to a database. So the idea are to provide a &#8220;REST&#8221; driver that can look into any given database. Since I needed look into any given table I could&#8217;nt use my ordinary stack with guice / warp persist and JPA. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=238&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These last days I&#8217;ve been working on a Rest application  which provides a generic interface to a database. So the idea are to provide a &#8220;REST&#8221; driver that can look into any given database. Since I needed look into any given table I could&#8217;nt use my ordinary stack with guice / warp persist and JPA. But had to create my own jdbc template (like <a title="spring jdbc template" href="http://www.springbyexample.org/examples/simple-spring-jdbc-template.html">spring jdbc template</a>).  Doing db stuff one needs a connection pool and since C3P0 are somewhat dead (haven&#8217;t had a release in ages), I decided to go with Apache DBCP.</p>
<p>Im having one problem though if I use PoolableDatasource I get the dreaded &#8220;java.net.BindException: Address already in use: connect&#8221;. If I manage the pool via the ObjectPool myself, it works like a charm. Not what I&#8217;ve hoped for.</p>
<p>Im wondering if it would be better (simpler) if I i used http://www.jolbox.com/ (Bone CP). I guess some one should make something like the Spring jdbc template for guice.</p>
<p>I&#8217;ve done some more testing and found out following things:</p>
<ul>
<li>C3P0 are simple to setup, you can always owervrite defaults by property files or xml files</li>
<li>C3P0 are slower than Apache DBCP</li>
<li>Apache DBCP, pooled connection does not work or I am using it wrong</li>
<li>Bone CP, <del datetime="2011-02-03T12:41:54+00:00">cannot connect to a jdbc uri with embedde password, user / password needs to be setup explicitly (which gives problems when using in memory hsql, no password / user)</del></li>
</ul>
<p>For now I think i will be sticking to C3P0 since i gives the most clean implentation, although a little slower than the rest (we are talking miliseconds, for 150 concurrent users).</p>
<p><strong>EDIT I need to revisit Bone CP since it has been updated and are now available in central repo <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/238/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/238/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/238/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=238&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2010/03/12/guice-jdbc/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Rest Guice and JAX-WS</title>
		<link>http://ninomartinez.wordpress.com/2010/03/10/rest-guice-and-jax-ws/</link>
		<comments>http://ninomartinez.wordpress.com/2010/03/10/rest-guice-and-jax-ws/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:06:05 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=234</guid>
		<description><![CDATA[These days im working on a small rest application, I found these resources to be helpful: http://docs.sun.com/app/docs/doc/820-7627/giqdq (archetypes) http://blog.curran.in/2010/02/creating-restful-service-with-jersey.html (setting up jax-ws with guice) https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html#d4e1111 (a little more info, but the article above are enough) http://xstream.codehaus.org/ (framework for creating xml fragments) So for unit tests im using dbuit to seed the hsql database and grizzly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=234&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>These days im working on a small rest application, I found these resources to be helpful:</p>
<p>http://docs.sun.com/app/docs/doc/820-7627/giqdq (archetypes)</p>
<p>http://blog.curran.in/2010/02/creating-restful-service-with-jersey.html (setting up jax-ws with guice)</p>
<p>https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html#d4e1111 (a little more info, but the article above are enough)</p>
<p>http://xstream.codehaus.org/ (framework for creating xml fragments)</p>
<p>So for unit tests im using dbuit to seed the hsql database and grizzly to run the application, jersey client acts as client.</p>
<p>I&#8217;ll probably add code examples to this article when I get time.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=234&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2010/03/10/rest-guice-and-jax-ws/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Building Software Cheat Sheet</title>
		<link>http://ninomartinez.wordpress.com/2009/12/10/building-software-cheat-sheet/</link>
		<comments>http://ninomartinez.wordpress.com/2009/12/10/building-software-cheat-sheet/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 21:55:40 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[Code Care]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=227</guid>
		<description><![CDATA[Building Software with a smile I&#8217;ve been wanting to write this article for a while now, I use all my articles as personal notes, plus giving back to the community are something that counts in my book aswell. The article are about how we manage and build our software at work and the stuff im [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=227&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>Building Software with a smile</h2>
<p>I&#8217;ve been wanting to write this article for a while now, I use all my articles as personal notes, plus giving back to the community are something that counts in my book aswell. The article are about how we manage and build our software at work and the stuff im using for my private pet projects. It&#8217;s an ever evolving process, that will probably never stop. There&#8217;s always process&#8217;s that can be simplified. It&#8217;s a short article that you can use for getting a stack together quick. Enough chatter, onto the fun stuff <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2>Methodologies</h2>
<p>We try to adhere under the ideas of people like Robert Martin (whom have summed up a lot of ideas of other people), go grab <a href="http://www.amazon.co.uk/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882">clean code</a> you wont regret it. In short write code in a minimalistic readable way, remember to test it, care about your code and smile. Clean code really has summed it all up. Although there&#8217;s a lot of books on the topic&#8217;s of coding, testing etc. It&#8217;s my favorite. Oh and do not forget something like <a href="http://ninomartinez.wordpress.com/2008/06/18/scrum/">scrum</a>.</p>
<h2>Language</h2>
<p>I&#8217;m not going to rant about why but we use Java, there&#8217;s several reasons but I have no deeper feelings about this topic, I havent looked enough into Ruby, Scala etc. to be a judge. Mostly that there&#8217;s so many things available for Java, however the same are the case for Grails, Rails etc. I just like static languages a bit more. However the topics in are not in depth about Java.</p>
<h2>Building System</h2>
<p>We are using Apache Maven 2, which has some really nice features like it&#8217;s convenience over configuration. There&#8217;s very good integration towards build servers and a huge list of plug-ins that&#8217;ll to the job for you. Just rememberer do it the maven way, and let the system work for you, do not fight it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  One side of Maven are testing, for that we are using a mixture of Junit4, Jmock and JBehave that ensures us maximum freedom and productivity.</p>
<h2>Build Server</h2>
<p>As for build server we are using Hudson, it&#8217;s simple and straight forward. It has great integration towards maven, I guess we could just as well have used Continuum but Hudson worked on first try Continuum did not. In Hudson we have three projects per Maven project, one for continuous integration and one for making a release and one for our metrics. The CI project are notified by our version system upon changes, then grabs the source and builds. The release project awaits when we are ready for a release, and then assigned build manager &#8220;clicks&#8221; build, awaits and downloads the finished release product, simple as that! The release process of course, checks out a fresh copy tags it in scm builds and releases/package the artifacts. I&#8217;ll write a bit about the metrics project below.</p>
<h3>Metrics</h3>
<p>Now what goes hand in hand with a build server are a metrics analyser like Sonar which actually are a bunch of subprojects packaged nicely together and presented in style. It&#8217;s really easy to add to any Maven project just have the sonar running and run mvn sonar:sonar and voila fresh metrics. Just remember sonar will only keep one set of metrics per day AFAIK.</p>
<p>Before I discovered Sonar I used a lot of time configuring Maven metric plugins. However Sonar does it all and easy, plus have a lot of features/plugins, like timeline hotspots and quick wins. Very nice all in all.</p>
<h2>Version System</h2>
<p>For scm we use Subversion, no real arguments here it works for me and I haven&#8217;t tried out any other scm. Most annoying thing though are that we are having some trouble using branches (svn 1.5 using eclipse/tortoise etc) otherwise not much to say. I&#8217;ve peeking a bit towards git, but haven&#8217;t had the time to go further.</p>
<h2>Ticket System &amp; Wiki</h2>
<p>For Tickets/Defects/issues &amp; Wiki we use trac. Reasons are that it&#8217;s simple and materialistic. Although sometimes to minimal, theres always a plugin that will just expand trac the way you want. Only thing that are bothersome is working with multiple trac sites. I&#8217;ve been eager to try redmine out, it seems like trac but can a bit more. So heres what im missing in trac:</p>
<ul>
<li>Ticket dependencies</li>
<li>Multiple site support easy</li>
</ul>
<h2>IDE</h2>
<p>We use Eclipse, mainly because it&#8217;s the one I&#8217;ve been using longest and one of our vendors has made a specific product based on eclipse. I&#8217;ve tried both subclipse and subversive, and can&#8217;t figure out what are best. None of them seems to be working optimally with branches. Only way to get a good diff when merging a branch are in svn command line :/ One note though we are limited to Eclipse 3.2 and plugins that support that. So it might be better in newer versions.</p>
<p>I&#8217;ve been told a couple of times by different people that idea, are better and actually will make you more productive. And now with the free community version I might give it a try.</p>
<h2>Links</h2>
<p>So following above, you should be set all the software mentioned in this article are free. Now go download and start making the world a better place. There&#8217;s a lot of projects out there waiting for you, either open source or for money. And just remember it&#8217;s better to try than not, some one once said it&#8217;s by our mistakes we learn <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Stuff we use:</p>
<ul>
<li>http://trac.edgewall.org/</li>
<li>http://hudson.dev.java.net/</li>
<li>http://subversion.tigris.org/</li>
<li>http://maven.apache.org/</li>
<li>http://sonar.codehaus.org/</li>
<li>http://www.eclipse.org/</li>
</ul>
<p>Stuff that i&#8217;d like to investigate:</p>
<ul>
<li>http://git-scm.com/</li>
<li>http://www.redmine.org/</li>
<li>http://www.jetbrains.com/idea/</li>
</ul>
<p>Ohh and if you have any comment&#8217;s feel free to write.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=227&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2009/12/10/building-software-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Cleaning Code Practically Episode 1</title>
		<link>http://ninomartinez.wordpress.com/2009/10/08/cleaning-code-practically-episode-1/</link>
		<comments>http://ninomartinez.wordpress.com/2009/10/08/cleaning-code-practically-episode-1/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 18:27:01 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[Code Care]]></category>
		<category><![CDATA[JAVA]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=222</guid>
		<description><![CDATA[Last Øredev I were at a presentation done by Robert Martin, author of the book Clean Code. I were really impressed by what his message where. So we are trying to follow his word at work and today a topic came up. So a colleague had this code: public String getRequestString() throws MQException { String [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=222&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last Øredev I were at a presentation done by <a href="http://www.objectmentor.com/omTeam/martin_r.html">Robert Martin</a>, author of the book Clean Code. I were really impressed by what his message where. So we are trying to follow his word at work and today a topic came up. So a colleague had this code:</p>
<p><code><br />
public String getRequestString() throws MQException {<br />
 String request = "";<br />
 request += Helper.leftRightFilled(true, String.valueOf(getSessionNumberAndIncreaseIt()), '0', 3);<br />
 request += Helper.leftRightFilled(true, getVersion(), '0', 3);<br />
 request += Helper.leftRightFilled(true, getTransaction(), 'X', 4);<br />
 request += Helper.leftRightFilled(true, getLanguage(), 'X', 2);<br />
 request += Helper.leftRightFilled(true, getCallersPhoneNumber(), '0',16);<br />
 request += Helper.leftRightFilled(false, dynamicSettingMQ.getCustomerNumber(), ' ', 16);<br />
 request += Helper.leftRightFilled(true, String.valueOf(dynamicSettingMQ.getNumberOfUnsucceededCalls()), '0', 3);<br />
 return request;<br />
}<br />
</code></p>
<p>I intermediately though that could be more readable, so I just pushed a lot into functions, and did a little to the helper class:<br />
<code><br />
public String getRequestString() throws MQException {<br />
 String request = "";<br />
 request += createSessionNumberString();<br />
 request += createVersionString();<br />
 request += createTransactionString();<br />
 request += createLanguageString();<br />
 request += createCallersPhoneNumberString();<br />
 request += createCustomerNumberString();<br />
 request += createNumberOfUnsucceededCallsString();<br />
 return request;<br />
}<br />
protected String createCallersPhoneNumberString() throws MQException {<br />
 return Helper.leftRightFilled(true, getCallersPhoneNumber(), '0', 16);<br />
}<br />
protected String createCustomerNumberString() throws MQException {<br />
 return Helper.leftRightFilled(false, dynamicSettingMQ.getCustomerNumber(), ' ', 16);<br />
}<br />
protected String createLanguageString() throws MQException {<br />
 return Helper.leftRightFilled(true, getLanguage(), 'X', 2);<br />
}<br />
protected String createNumberOfUnsucceededCallsString() throws MQException {<br />
 return Helper.leftRightFilled(true, dynamicSettingMQ.getNumberOfUnsucceededCalls(), '0', 3);<br />
}<br />
protected String createSessionNumberString() throws MQException {<br />
 return Helper.leftRightFilled(true, getSessionNumberAndIncreaseIt(),'0', 3);<br />
}<br />
protected String createTransactionString() throws MQException {<br />
 return Helper.leftRightFilled(true, getTransaction(), 'X', 4);<br />
}<br />
protected String createVersionString() throws MQException {<br />
 return Helper.leftRightFilled(true, getVersion(), '0', 3);<br />
}<br />
}<br />
</code></p>
<p>At first the colleague thought it was nice, but then remembered he really needed a overview of locations used in the string manipulation. So a thing between the two are needed:<br />
<code><br />
public String getRequestString() throws MQException {<br />
 String request = "";<br />
 request += createSessionNumberString('0', 3);<br />
 request += createVersionString('0', 3);<br />
 request += createTransactionString('X', 4);<br />
 request += createLanguageString('X', 2);<br />
 request += createCallersPhoneNumberString('0', 16);<br />
 request += createCustomerNumberString(' ', 16);<br />
 request += createNumberOfUnsucceededCallsString('0', 3);<br />
 return request;<br />
}<br />
protected String createCallersPhoneNumberString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(true, getCallersPhoneNumber(), fillWith,length);<br />
}<br />
protected String createCustomerNumberString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(false, dynamicSettingMQ.getCustomerNumber(), fillWith,length);<br />
}<br />
protected String createLanguageString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(true, getLanguage(), fillWith,length);<br />
}<br />
protected String createNumberOfUnsucceededCallsString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(true, dynamicSettingMQ.getNumberOfUnsucceededCalls(), fillWith,length);<br />
}<br />
protected String createSessionNumberString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(true, getSessionNumberAndIncreaseIt(),fillWith,length);<br />
}<br />
protected String createTransactionString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(true, getTransaction(), fillWith,length);<br />
}<br />
protected String createVersionString(char fillWith, int length) throws MQException {<br />
 return Helper.leftRightFilled(true, getVersion(), fillWith, length);<br />
}<br />
</code></p>
<p>Im not satisfied, but not sure it can be done more clean? And if you are wondering about why we are doing all this string manipulation, we are working with some legacy MQ. If we split up the code without parameters as above we lose the quick overview.. But could the code be simplified even more please come with your suggestion..</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/222/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/222/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/222/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=222&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2009/10/08/cleaning-code-practically-episode-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse 3.2 And Subversive</title>
		<link>http://ninomartinez.wordpress.com/2009/07/03/eclipse-3-2-and-subversive/</link>
		<comments>http://ninomartinez.wordpress.com/2009/07/03/eclipse-3-2-and-subversive/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 20:47:39 +0000</pubDate>
		<dc:creator>ninomartinez</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[Nortel SCE]]></category>

		<guid isPermaLink="false">http://ninomartinez.wordpress.com/?p=213</guid>
		<description><![CDATA[Seems like gremlins in my machine, first time we at work did a branch the branch received changes from trunk. But did not push stuff back to trunk. Merging was simple since the branch always was up to date with trunk and only had a few changes.. Some time passed and we tried doing a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=213&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Seems like gremlins in my machine, first time we at work did a branch the branch received changes from trunk. But did not push stuff back to trunk. Merging was simple since the branch always was up to date with trunk and only had a few changes..</p>
<p>Some time passed and we tried doing a new branch, a few problems, but at last we finally made the branch. Worked with it, but now subversive and tortoise refuses to merge the branch back again! I&#8217;ve tried a million things. In the end I checked out trunk removed the affected parts and added the ones from the branch and commitet those again. Just to get our system into working order..</p>
<p>My primary suspicion now are that doing branches are very affected by which svn provider you chose, nothings confirmed, but I know we&#8217;ve switched providers since the first successful branching.</p>
<p>Any other experiencing troubles with this ancient version of eclipse &amp; subversive?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ninomartinez.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ninomartinez.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ninomartinez.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ninomartinez.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ninomartinez.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ninomartinez.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ninomartinez.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ninomartinez.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ninomartinez.wordpress.com&amp;blog=3320673&amp;post=213&amp;subd=ninomartinez&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ninomartinez.wordpress.com/2009/07/03/eclipse-3-2-and-subversive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/5ba67605a7b22857e1bfb59c0d7dad7d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ninomartinez</media:title>
		</media:content>
	</item>
	</channel>
</rss>
