<?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>Ron on software &#187; ron</title>
	<atom:link href="http://rpstechnologies.net/ron/blog/author/ron/feed/" rel="self" type="application/rss+xml" />
	<link>http://rpstechnologies.net/ron/blog</link>
	<description>Thoughts on software development</description>
	<lastBuildDate>Sun, 29 Apr 2012 02:29:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Making Eclipse run configurations portable</title>
		<link>http://rpstechnologies.net/ron/blog/2012/04/making-eclipse-run-configurations-portable/</link>
		<comments>http://rpstechnologies.net/ron/blog/2012/04/making-eclipse-run-configurations-portable/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 02:29:56 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=245</guid>
		<description><![CDATA[I&#8217;m using Eclipse, GWT, and Maven on a couple projects, and have several customized Eclipse run configurations I use. There&#8217;s a bit of work and specific settings required to make these work well, and they have to be set up &#8230; <a href="http://rpstechnologies.net/ron/blog/2012/04/making-eclipse-run-configurations-portable/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using Eclipse, GWT, and Maven on a couple projects, and have several customized Eclipse run configurations I use.  There&#8217;s a bit of work and specific settings required to make these work well, and they have to be set up for each new workspace, so I&#8217;d like to set them up once and share them with the team.</p>
<p>Before being able to check these into source control, and make them available to the rest of the team, there&#8217;s a couple things in these run configurations that have platform-specific references (e.g. the full path to files on my hard drive) that have to be fixed.  Fortunately, if you know where to look it&#8217;s not hard to change.</p>
<p>First, the GWT launch configuration which is generated by the <a href="https://developers.google.com/eclipse/" title="Google Eclipse Plugin">Google Eclipse Plugin</a> needs to be fixed.  As described in this <a href="http://stackoverflow.com/questions/3557369/how-to-use-variables-for-classpath-definition-in-eclipse-launch-configurations" title="stackoverflow question on GWT eclipse launcher">stackoverflow question</a>, the classpath used by the launcher contains a hard-coded full path to the GWT development jar on your computer.  The solution is to change the path to be relative to a classpath variable which is defined at the workspace level.  In my case, I need to use the M2_REPO classpath variable which points to my local Maven repository.</p>
<p>To change this, open the Eclipse Run Configuration for the GWT launcher in question, select the Classpath tab, click the &#8220;Advanced&#8221; button on the right to add a new classpath entry, choose &#8220;Classpath Variable&#8221; in the dialog that comes up, then choose the classpath variable you want to use.  Assuming the jar file you need to select is in a subdirectory below the classpath variable, click on &#8220;Extend&#8221; to navigate to the jar file relative to the classpath variable.</p>
<p><a href="http://rpstechnologies.net/ron/blog/wp-content/uploads/2012/04/runConfiguration.png"><img src="http://rpstechnologies.net/ron/blog/wp-content/uploads/2012/04/runConfiguration.png" alt="" width="1005" height="830" class="aligncenter size-full wp-image-265" /></a></p>
<p>Once your new classpath entry is in place, you can remove the old one with the hard-coded path.</p>
<p>For the Maven run configurations, the only thing that was platform-specific was the base directory setting on the first tab, which by default is the full directory path to the project.  </p>
<p><a href="http://rpstechnologies.net/ron/blog/wp-content/uploads/2012/04/mavenRunConfig.png"><img src="http://rpstechnologies.net/ron/blog/wp-content/uploads/2012/04/mavenRunConfig.png" alt="" width="631" height="594" class="aligncenter size-full wp-image-273" /></a></p>
<p>To make this portable, you can make this location relative to the named project that&#8217;s loaded in the current workspace.  Click &#8220;Browse Workspace&#8230;&#8221; and select the project that the Maven build should run from.  You&#8217;ll end up with a location like ${workspace_loc:/my-project}.</p>
<p>For both of these run configurations, the last thing that needs to be done is to save them as a file within the project.  Select the last tab of the run configuration, &#8220;Common&#8221;, select &#8220;Shared File&#8221; under &#8220;Save as&#8221;, and choose a directory for the run configuration to be saved to.</p>
<p><a href="http://rpstechnologies.net/ron/blog/wp-content/uploads/2012/04/savingRunConfig.png"><img src="http://rpstechnologies.net/ron/blog/wp-content/uploads/2012/04/savingRunConfig.png" alt="" width="684" height="561" class="aligncenter size-full wp-image-281" /></a>.  You can now check these files into source control and load them into another workspace.</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2012/04/making-eclipse-run-configurations-portable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sculptor lately</title>
		<link>http://rpstechnologies.net/ron/blog/2012/03/sculptor-lately/</link>
		<comments>http://rpstechnologies.net/ron/blog/2012/03/sculptor-lately/#comments</comments>
		<pubDate>Mon, 12 Mar 2012 01:57:18 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[sculptor]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=240</guid>
		<description><![CDATA[The latest version, 2.1.0, of Sculptor came out and it has some great features including JPA 2.0 support, custom finder methods generated from the DSL, and a fluent domain object builders feature I contributed. Other than the builders feature, I &#8230; <a href="http://rpstechnologies.net/ron/blog/2012/03/sculptor-lately/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The latest version, 2.1.0, of <a href="http://fornax.itemis.de/confluence/display/fornax/Sculptor+%28CSC%29">Sculptor</a> came out and it has some great features including JPA 2.0 support, custom finder methods generated from the DSL, and a <a href="http://fornax.itemis.de/confluence/display/fornax/3.+Advanced+Tutorial+%28CSC%29#3.AdvancedTutorial%28CSC%29-DomainObjectBuilders">fluent domain object builders</a> feature I contributed.</p>
<p>Other than the builders feature, I haven&#8217;t been able to work with the new features as I&#8217;m working on a Sculptor GWT GUI branch based on the 2.0 release.  At some point I&#8217;ll migrate my branch to the latest and get to use these goodies.</p>
<p>On the horizon, there&#8217;s work being done on migrating Sculptor to the latest versions of <a href="http://www.eclipse.org/Xtext/">XText and XTend</a> which look like great advancements, and <a href="http://groups.google.com/group/fornax-platform/browse_thread/thread/fd4eed366e3e3f70">Hibernate 4.X support has just been added to trunk</a> by Oliver Ringel.</p>
<p>Not tied to a particular release, but Torsten Juergeleit has also done some great work with a new <a href="https://groups.google.com/d/msg/fornax-platform/FiWmpEgbEv0/z_Q2c3Mi2WoJ">all-in-one Maven Sculptor plugin</a> which does the work of what used to be 3 separate plugins.</p>
<p>Lots of exciting developments for Sculptor.  I&#8217;ll write more on the Sculptor GWT GUI work in a future post.</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2012/03/sculptor-lately/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java multiple dispatch / multimethod libraries</title>
		<link>http://rpstechnologies.net/ron/blog/2011/06/java-multiple-dispatch-multimethod-libraries/</link>
		<comments>http://rpstechnologies.net/ron/blog/2011/06/java-multiple-dispatch-multimethod-libraries/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 23:02:13 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=229</guid>
		<description><![CDATA[Multiple dispatch (aka multimethods) is a method dispatch feature of some languages whereby the method that is dispatched to is based on the runtime type of the method arguments, not just the runtime type of the class being called (single &#8230; <a href="http://rpstechnologies.net/ron/blog/2011/06/java-multiple-dispatch-multimethod-libraries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Multiple dispatch (aka multimethods) is a method dispatch feature of some languages whereby the method that is dispatched to is based on the <em>runtime</em> type of the method arguments, not just the runtime type of the class being called (single dispatch polymorphism), and compile-time type of the method arguments.</p>
<p>Java doesn&#8217;t support multiple dispatch at a language level, but fortunately, it can be implemented in a library.</p>
<p>A simple test program to show Java behavior:</p>
<pre class="brush: java; title: ; notranslate">
public class Mapper {

	static abstract class Content {}

	static class Link extends Content {}

	static class Message extends Content {}

	void map(Content c) {
		System.out.println(&quot;shouldn't get here!&quot;);
	}

	void map(Link l) {
		System.out.println(&quot;It's a Link&quot;);
	}

	void map(Message m) {
		System.out.println(&quot;It's a message&quot;);
	}

	public static void main(String[] args) {
		Mapper mapper = new Mapper();
		Content c1 = new Link();
		Content c2 = new Message();
		mapper.map(c1);
		mapper.map(c2);
	}
}
</pre>
<p>The output for the above test program is:</p>
<pre class="brush: bash; title: ; notranslate">
shouldn't get here!
shouldn't get here!
</pre>
<p>Java is dispatching to the overloaded <em>map</em> method based on the compile-time type of c1 and c2, which is the Content class.  The above example is a bit contrived, but it shows that when working with base class references, for instance if you are working with a List of Content objects, Java won&#8217;t dispatch based on the runtime type.</p>
<p>I set out looking for a library that would implement multiple dispatch.  I was a bit surprised the Google Guava library didn&#8217;t implement it.  This seems to be right up their alley.  What I did find was the following implementation: <a href="http://logand.com/blog/jmultimethod/index.html">jmultimethod</a></p>
<p>Nice and simple, multiple dispatch using annotations and reflection.</p>
<p>Using jmultimethod, our test program becomes:</p>
<pre class="brush: java; title: ; notranslate">
package org.sculptor.mapprovisions.domain;

import jmultimethod.Multi;
import jmultimethod.Multimethod;

public class Mapper {

	// Object responsible for doing the dispatching
    protected static Multimethod mapMM =
        new Multimethod(&quot;map&quot;, Mapper.class);

	static abstract class Content {}

	static class Link extends Content {}

	static class Message extends Content {}

    @Multi(&quot;map&quot;)
	public void map(Content c) {
		System.out.println(&quot;shouldn't get here!&quot;);
	}

    @Multi(&quot;map&quot;)
	public void map(Link l) {
		System.out.println(&quot;It's a Link&quot;);
	}

    @Multi(&quot;map&quot;)
	public void map(Message m) {
		System.out.println(&quot;It's a Message&quot;);
	}

	public static void main(String[] args) {
		Mapper mapper = new Mapper();
		Content c1 = new Link();
		Content c2 = new Message();

		// Invoke the multiple-dispatch method &quot;map&quot; on mapper, passing c1 as an argument
		mapMM.invoke(mapper, c1);

		// Invoke the multiple-dispatch method &quot;map&quot; on mapper, passing c2 as an argument
		mapMM.invoke(mapper, c2);
	}
}
</pre>
<p>The new output is:</p>
<pre class="brush: bash; title: ; notranslate">
It's a Link
It's a Message
</pre>
<p>I&#8217;d still prefer to have it directly supported by Java, but it&#8217;s good to have this solution when needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2011/06/java-multiple-dispatch-multimethod-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web and mobile UI wireframes</title>
		<link>http://rpstechnologies.net/ron/blog/2011/06/web-and-mobile-ui-wireframes/</link>
		<comments>http://rpstechnologies.net/ron/blog/2011/06/web-and-mobile-ui-wireframes/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 04:10:10 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=223</guid>
		<description><![CDATA[People think visually. A picture is worth a thousand words as the saying goes. We&#8217;ve recently been using Balsamiq to put together wireframes we use to work out user experience concepts, and to work with stakeholders. Balsamiq is an Adobe &#8230; <a href="http://rpstechnologies.net/ron/blog/2011/06/web-and-mobile-ui-wireframes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>People think visually.  A picture is worth a thousand words as the saying goes.</p>
<p>We&#8217;ve recently been using <a href="http://balsamiq.com/">Balsamiq</a> to put together wireframes we use to work out user experience concepts, and to work with stakeholders.  Balsamiq is an Adobe AIR-based desktop application that can be used to quickly put together web and mobile UI wireframes.  It&#8217;s also relatively easy to make clickable demos in Balsamiq by stringing together screen wireframes.</p>
<p>What I probably like most about Balsamiq, is the wireframes have a rough and unfinished look to them.  They get the point across, but purposefully look informal so people focus on the general concepts and information presented on the UI, and not the color or exact positioning of buttons.</p>
<p>If you&#8217;re an <a href="http://www.omnigroup.com/products/omnigraffle/">OmniGraffle</a> user, there&#8217;s some stencils that are also a good option, among them <a href="http://konigi.com/tools/omnigraffle-wireframe-stencils">Konigi</a>, and <a href="http://developer.yahoo.com/ypatterns/about/stencils/">Yahoo Design Stencils</a> (also available for Visio and in other formats).</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2011/06/web-and-mobile-ui-wireframes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Customizing Sculptor to generate Groovy classes</title>
		<link>http://rpstechnologies.net/ron/blog/2010/11/customizing-sculptor-to-generate-groovy-classes/</link>
		<comments>http://rpstechnologies.net/ron/blog/2010/11/customizing-sculptor-to-generate-groovy-classes/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 20:55:23 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[MDSD]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[sculptor]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=184</guid>
		<description><![CDATA[I&#8217;ve been using the Sculptor DSL/tool to build Java EE applications based on DDD and EDA principles. This has worked out great, and Sculptor allows me to express the intent at a higher level and more succinctly than I could &#8230; <a href="http://rpstechnologies.net/ron/blog/2010/11/customizing-sculptor-to-generate-groovy-classes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the <a href="http://fornax.itemis.de/confluence/display/fornax/Sculptor+(CSC)">Sculptor DSL/tool</a> to build Java EE applications based on <a href="http://en.wikipedia.org/wiki/Domain-driven_design">DDD</a> and <a href="http://en.wikipedia.org/wiki/Event-driven_architecture">EDA</a> principles.  This has worked out great, and Sculptor allows me to express the intent at a higher level and more succinctly than I could with straight Java or another GPL.</p>
<p>When it comes to expressing the behavior of your domain, that&#8217;s done outside of the Sculptor DSL, using Java.  The Sculptor DSL is largely about the solution structure; the structure and relationship between classes, and what standard behaviors they support, such as CRUD repository methods.  If you need to implement complex logic for your credit score calculator class, Sculptor is used to define the interface into your method, but it&#8217;s up to you to implement the logic for that method in Java.  After a while, I found this was significantly slowing me down.  Java is so verbose compared to languages such as Groovy or Scala, in particular when it comes to working with object graphs and functional programming.</p>
<p>Fortunately, Sculptor and the XText tools it is based on support customizing each step of the generation process.  This post outlines what I did to customize Sculptor to allow me to implement my domain and service classes in Groovy.  This only applies to the concrete implementation classes you would customize when using the &#8216;gap&#8217; generation option.  The base classes that are regenerated each time are still Java, as there was no benefit to using a different language for them.</p>
<p>The following changes should be made to the business tier project.</p>
<p><strong>Maven POM updates</strong></p>
<p>First, the Groovy libraries and a Groovy compiler need to be added to the Maven build  Traditionally this was done using the <a href="http://docs.codehaus.org/display/GMAVEN/Home">GMaven plugin</a>, but I came across <a href="http://contraptionsforprogramming.blogspot.com/2010/09/where-are-all-my-stubs.html">this post</a> that describes using the eclipse-groovy plugin to jointly compile Java and Groovy together in a single pass.  Much better.</p>
<p>To use this, modify the pom.xml to add the springsource maven dependency and plugin repositories:</p>
<pre class="brush: xml; title: ; notranslate">
	&lt;repositories&gt;
		&lt;repository&gt;
			&lt;id&gt;springsource&lt;/id&gt;
			&lt;url&gt;http://maven.springframework.org/snapshot&lt;/url&gt;
			&lt;releases&gt;
				&lt;enabled&gt;true&lt;/enabled&gt;
			&lt;/releases&gt;
			&lt;snapshots&gt;
				&lt;enabled&gt;true&lt;/enabled&gt;
			&lt;/snapshots&gt;
		&lt;/repository&gt;
	&lt;/repositories&gt;

	&lt;pluginRepositories&gt;
		&lt;pluginRepository&gt;
			&lt;id&gt;springsource&lt;/id&gt;
			&lt;url&gt;http://maven.springframework.org/snapshot&lt;/url&gt;
		&lt;/pluginRepository&gt;
	&lt;/pluginRepositories&gt;
</pre>
<p>Then update the maven-compiler plugin in the build/plugins section to use the groovy-ecilpse-compiler:</p>
<pre class="brush: xml; title: ; notranslate">
			&lt;plugin&gt;
				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
				&lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
				&lt;version&gt;2.3.1&lt;/version&gt;
				&lt;configuration&gt;
					&lt;encoding&gt;ISO-8859-1&lt;/encoding&gt;
					&lt;source&gt;1.6&lt;/source&gt;
					&lt;target&gt;1.6&lt;/target&gt;
					&lt;compilerId&gt;groovy-eclipse-compiler&lt;/compilerId&gt;
					&lt;verbose&gt;true&lt;/verbose&gt;
				&lt;/configuration&gt;
				&lt;dependencies&gt;
					&lt;dependency&gt;
						&lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
						&lt;artifactId&gt;groovy-eclipse-compiler&lt;/artifactId&gt;
						&lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
					&lt;/dependency&gt;
				&lt;/dependencies&gt;
			&lt;/plugin&gt;
</pre>
<p>Finally, add groovy to your dependencies:</p>
<pre class="brush: xml; title: ; notranslate">
		&lt;dependency&gt;
			&lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
			&lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
			&lt;version&gt;1.7.5&lt;/version&gt;
			&lt;type&gt;jar&lt;/type&gt;
		&lt;/dependency&gt;
</pre>
<p><strong>Xpand templates</strong></p>
<p>The next step is to create Xpand templates that will generate Groovy class files instead of Java.  I&#8217;m using the Sculptor &#8216;hint&#8217; feature to control whether a class will get generated as Java or Groovy.  If a Service or Domain class is annotated with hint=&#8221;gapImpl=groovy&#8221;, Groovy will be generated, otherwise it&#8217;ll fall back to the default of Java.</p>
<p>The code below defines an aspect for the generation of the DomainObject and Service sub-classes.  Whenever these templates are invoked within Sculptor, the aspect below will be evaluated, deciding whether to generate Groovy code or to proceed with the normal Sculptor templates. </p>
<p>Add to src/main/resources/templates/SpecialCases.xpt:</p>
<pre class="brush: xml; title: ; notranslate">
«AROUND *::domainObjectSubclass FOR DomainObject»
        «IF getHint(&quot;gapImpl&quot;) == &quot;groovy&quot;»
                «EXPAND Groovy::Groovy»
        «ELSE»
            «targetDef.proceed()»
        «ENDIF»
«ENDAROUND»

«AROUND *::serviceImplSubclass FOR Service»
        «IF getHint(&quot;gapImpl&quot;) == &quot;groovy&quot;»
                «EXPAND Groovy::GroovyService»
        «ELSE»
            «targetDef.proceed()»
        «ENDIF»
«ENDAROUND»
</pre>
<p>Next, define the templates that will generate the actual Groovy code.  Since Groovy syntax is practically a superset of Java, I was able to copy the code from the existing Sculptor templates (DomainObject.xpt and Service.xpt).  The one key difference is where the code gets generated to &#8211; a new helper function groovyFileName returns a .groovy file name.</p>
<p>Create src/main/resources/templates/Groovy.xpt:</p>
<pre class="brush: xml; title: ; notranslate">
«REM»
Templates to generate Sculptor implementation classes as Groovy
«ENDREM»

«IMPORT sculptormetamodel»
«EXTENSION extensions::helper»
«EXTENSION extensions::groovyhelper»
«EXTENSION extensions::properties»

«DEFINE Groovy FOR DomainObject»
«FILE groovyFileName(getDomainPackage() + &quot;.&quot; + name) TO_SRC»
«javaHeader()»
package «getDomainPackage()»;

«IF formatJavaDoc() == &quot;&quot; -»
/**
 * Data transfer object for «name». Properties and associations are
 * implemented in the generated base class {@link «getDomainPackage()».«name»Base}.
 */
«ELSE -»
«formatJavaDoc()»
«ENDIF -»
«EXPAND templates::DomainObject::domainObjectSubclassAnnotations»
public «getAbstractLitteral()»class «name» extends «name»Base {
        «EXPAND templates::DomainObject::serialVersionUID»
    «IF getLimitedConstructorParameters().isEmpty || getMinimumConstructorParameters().isEmpty»public«ELSE»protected«ENDIF» «name»() {
    }

    «EXPAND templates::DomainObject::propertyConstructorSubclass»
    «EXPAND templates::DomainObject::limitedConstructor»
    «EXPAND templates::DomainObject::minimumConstructor»

}
«ENDFILE»
«ENDDEFINE»

«DEFINE GroovyService FOR Service»
	«FILE groovyFileName(getServiceimplPackage() + &quot;.&quot; + name + &quot;Impl&quot;) TO_SRC»
«javaHeader()»
package «getServiceimplPackage()»;

/**
 * Implementation of «name».
 */
«IF isSpringAnnotationToBeGenerated()»
@org.springframework.stereotype.Service(&quot;«name.toFirstLower()»&quot;)
«ENDIF»
«IF webService»
«EXPAND webServiceAnnotations»
«ENDIF»
public class «name»Impl extends «name»ImplBase {

    public «name»Impl() {
    }
	«EXPAND templates::Service::otherDependencies»

    «EXPAND templates::Service::implMethod FOREACH operations.select(op | op.delegate == null &amp;&amp; op.serviceDelegate == null)
    	.reject(e|e.hasHint(&quot;EventSourcingScaffold&quot;)) »
}
	«ENDFILE»
«ENDDEFINE»
</pre>
<p><strong>Xtend helper function</strong></p>
<p>The last step is to define the helper function used above to return the groovy file name.</p>
<p>Create src/main/resources/extensions/groovyhelper.ext:</p>
<pre class="brush: java; title: ; notranslate">
import sculptormetamodel;

String groovyFileName(String name) :
    name.replaceAll(&quot;\\.&quot;, &quot;/&quot;) + &quot;.groovy&quot;;
</pre>
<p><strong>Model file</strong></p>
<p>Finally, to use this, add the hint to whatever Service or Domain classes you need it for in your model file:</p>
<pre class="brush: java; title: ; notranslate">
		Service MyService {
			gap
			hint=&quot;gapImpl=groovy&quot;
			...
		}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2010/11/customizing-sculptor-to-generate-groovy-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fornax Sculptor DSL tool: Switching an existing app to MongoDB</title>
		<link>http://rpstechnologies.net/ron/blog/2010/09/fornax-sculptor-dsl-tool-switching-an-existing-app-to-mongodb/</link>
		<comments>http://rpstechnologies.net/ron/blog/2010/09/fornax-sculptor-dsl-tool-switching-an-existing-app-to-mongodb/#comments</comments>
		<pubDate>Sun, 05 Sep 2010 23:35:00 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[MDSD]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=146</guid>
		<description><![CDATA[Fornax Sculptor is a DSL, Eclipse-based editor, and set of code generators used to build Java/JEE applications.  You define your model and other parts of your application in the Sculptor textual DSL, and the Sculptor model transformations and code generators &#8230; <a href="http://rpstechnologies.net/ron/blog/2010/09/fornax-sculptor-dsl-tool-switching-an-existing-app-to-mongodb/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a title="Fornax Sculptor" href="http://fornax.itemis.de/confluence/display/fornax/Sculptor+%28CSC%29">Fornax Sculptor</a> is a DSL, Eclipse-based editor, and set of code generators used to build Java/JEE applications.  You define your model and other parts of your application in the Sculptor textual DSL, and the Sculptor model transformations and code generators generate Java code, Spring configuration, Hibernate mappings, and UI code.  Of course, Sculptor only takes you so far, which is where you supply your own code via extension points and composition/delegation, but Sculptor goes a long way to minimize repetitive code, and keeping you working closer to the actual problem domain.  You can also customize and extend Sculptor via the excellent Eclipse MDSD tools (Xtext, MWE, Xpand, Xtend, Check) that Sculptor is based on.</p>
<p>I&#8217;ve been building a JEE application using Sculptor, based on JSF2, Hibernate, MySQL, and Spring.  The latest release of Sculptor added support for MongoDB and Events.  I&#8217;ve been looking to eventually migrate this application to a distributed &amp; schema-less database, and more of an Event-Driven architecture, so I decided to try converting it.  All in all it went very smoothly.  Following are my notes on switching over a Sculptor application from Hibernate to MongoDB.</p>
<p><strong>Updating the Maven POM and Sculptor configuration</strong></p>
<p>First, remove mysql, hibernate, spring-jdbc and related dependencies from the business tier project pom, then add the following dependency:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;dependency&gt;
    &lt;groupId&gt;org.fornax.cartridges&lt;/groupId&gt;
    &lt;artifactId&gt;fornax-cartridges-sculptor-mongodb&lt;/artifactId&gt;
    &lt;version&gt;${sculptor.version}&lt;/version&gt;
&lt;/dependency&gt;
</pre>
<p>Then modify sculptor-generator.properties to switch the persistence tier from Hibernate to MongoDB.  Comment out:</p>
<pre class="brush: bash; title: ; notranslate">
#db.product=mysql
</pre>
<p>and add:</p>
<pre class="brush: bash; title: ; notranslate">
nosql.provider=mongoDb
</pre>
<p>Run a build:</p>
<pre class="brush: bash; title: ; notranslate">
mvn clean install
</pre>
<p><strong>Fix domain concrete classes</strong></p>
<p>If you have domain classes with gap classes, as I had, you&#8217;ll have some compile errors due to JPA-isms that are in the domain concrete classes.  Since these concrete domain classes are generated only once, they don&#8217;t get overwritten on the next build and still have the JPA-specific code in them.  Edit each concrete domain class that has a gap class, and remove the JPA-isms:</p>
<pre class="brush: java; title: ; notranslate">
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = &quot;LINK&quot;)
public class Link extends LinkBase {
</pre>
<p>The domain base classes don&#8217;t have to be modified, because they&#8217;re regenerated each build.</p>
<p><strong>Fix references to entity unique IDs in your custom code</strong></p>
<p>Another difference with the MongoDB persistence layer is that the entity unique IDs are Strings rather than Longs.  Any place in your hand-written code that uses entity IDs, you&#8217;ll need to make this change.</p>
<p><strong>Fix service and repository unit tests</strong></p>
<p>When using the JPA-based persistence tier, the service tests  are based on dbunit, which won&#8217;t work with MongoDB.  I did a quick search and didn&#8217;t find a dbunit-equivalent for MongoDB.  The Sculptor MongoDB test samples use a technique of setting up test data using Java code and the repository classes:</p>
<pre class="brush: java; title: ; notranslate">

package my.application.serviceapi;

...

/**
 * Spring based test with MongoDB.
 */
@RunWith(org.springframework.test.context.junit4.SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations =  {
    &quot;classpath:applicationContext-test.xml&quot;}
)
public class LinkServiceTest
    extends AbstractDependencyInjectionSpringContextTests
    implements LinkServiceTestBase {
    @Autowired
    private DbManager dbManager;
    @Autowired
    private LinkService linkService;

    @Before
    public void initTestData() {
        // Set up your test fixtures here:
        Link link1 = new Link(&quot;http://some.com&quot;, &quot;Some title&quot;);
        linkService.save(link1);
    }

    @Before
    public void initDbManagerThreadInstance() throws Exception {
        // to be able to do lazy loading of associations inside test class
        DbManager.setThreadInstance(dbManager);
    }

    @After
    public void dropDatabase() {
        Set&lt;String&gt; names = dbManager.getDB().getCollectionNames();
        for (String each : names) {
            if (!each.startsWith(&quot;system&quot;)) {
                dbManager.getDB().getCollection(each).drop();
            }
        }

        // dbManager.getDB().dropDatabase();
    }

    private int countRowsInDBCollection(String name) {
        return (int) dbManager.getDBCollection(name).getCount();
    }

    @Test
    public void testFindById() throws Exception {
        // Your test code and assertions here...
    }

}
</pre>
<p>Simply set up your test fixtures using your service/repository classes or the MongoDB DbManager within the initTestData() method.</p>
<p><strong>No support for findByQuery repository method</strong></p>
<p>When building, I got errors such as:</p>
<pre class="brush: bash; title: ; notranslate">
.../LinkAccessFactoryImpl.java:[21,66] cannot find symbol
symbol  : class MongoDbFindByQueryAccessImpl
location: package org.fornax.cartridges.sculptor.framework.accessimpl.mongodb
</pre>
<p>This is odd since LinkAccessFactoryImpl is a generated class.  The cause of this error was that I have findByQuery as one of my scaffolding operations that is generated for every repository.  But this type of method isn&#8217;t supported by the MongoDb cartridge.  In the future it&#8217;d be nice if there was a model validation that checked for this and generated an error before generating code.  To fix this, remove findByQuery from the list of default scaffolding operations in scupltor-generator.properties, if you have it there at all:</p>
<pre class="brush: bash; title: ; notranslate">
#scaffold.operations=findById,findAll,save,delete,findByQuery,findByKey,findByCondition
scaffold.operations=findById,findAll,save,delete,findByKey,findByCondition
</pre>
<p><strong>Fix bidirectional associations between aggregate roots</strong></p>
<p>I had a bidirectional association between domain aggregate roots that caused problems.  I had something along the lines of:</p>
<pre class="brush: java; title: ; notranslate">
    Entity A {
    aggregateRoot 

    - Set&lt;@A&gt; children &lt;-&gt; parent 

    - @A parent nullable &lt;-&gt; children
    }
</pre>
<p>This resulted in an endless loop in the generated data access code, because it was following both the parent and children associations when mapping the objects to a MongoDB document.</p>
<p>In hindsight, I think this should <em>not</em> be supported within Sculptor when using the MongoDB cartridge.  It may make sense for relational databases, but since MongoDB doesn&#8217;t support transactions across collections (ditto for most other NoSQL databases), it cannot be guaranteed that both sides of the association will be updated as a unit of work.  This also makes distributing your database across many nodes much more complicated.  I changed my model to make this a unidirectional association, problem solved.</p>
<p>An interesting point is that with MongoDB and similar databases, the association reference is stored on the &#8220;one&#8221; side of the association, rather than the &#8220;many&#8221; side as with relational databases.  The document at the &#8220;one&#8221; side of the association contains a list of IDs of the &#8220;many&#8221; instances.</p>
<p>Tip: To see how Sculptor maps entities to MongoDB documents, see the &#8220;mapper&#8221; package within your app.</p>
<p><strong>Add DbManagerFilter to web.xml</strong></p>
<p>Lastly, I had to add the DbManagerFilter servlet filter to the web.xml file.  This filter registers a DbManager instance in a thread local so that it may be used to lazy-load associations as needed within your JSF managed bean/Facelets code.</p>
<pre class="brush: xml; title: ; notranslate">

  &lt;filter&gt;
    &lt;filter-name&gt;dbManagerFilter&lt;/filter-name&gt;
    &lt;filter-class&gt;org.fornax.cartridges.sculptor.framework.accessimpl.mongodb.DbManagerFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
    &lt;filter-name&gt;dbManagerFilter&lt;/filter-name&gt;
    &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
</pre>
<p>Overall the switch to MongoDB went very smoothly, and there were very few changes I had to make, largely thanks to Sculptor.  The most significant change was switching the unit tests from using dbunit to using Java test fixtures.</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2010/09/fornax-sculptor-dsl-tool-switching-an-existing-app-to-mongodb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveJDBC: an implementation of the Active Record pattern for Java</title>
		<link>http://rpstechnologies.net/ron/blog/2010/07/activejdbc-activerecord-for-java/</link>
		<comments>http://rpstechnologies.net/ron/blog/2010/07/activejdbc-activerecord-for-java/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 03:52:32 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/?p=119</guid>
		<description><![CDATA[Igor Polevoy, who I&#8217;ve had the pleasure of working with on a couple projects, has just posted his ActiveJDBC project to Google code.  If you work on Java applications that access relational databases, you owe it to yourself to check it &#8230; <a href="http://rpstechnologies.net/ron/blog/2010/07/activejdbc-activerecord-for-java/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Igor Polevoy, who I&#8217;ve had the pleasure of working with on a couple projects, has just posted his <a title="ActiveJDBC" href="http://code.google.com/p/activejdbc/">ActiveJDBC</a> project to Google code.  If you work on Java applications that access relational databases, you owe it to yourself to check it out.</p>
<p>ActiveJDBC implements the Active Record pattern, initially documented by Martin Fowler in his book <a href="http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1280276337&amp;sr=8-1">Patterns of Enterprise Application Architecture</a> and popularized by Ruby on Rails.</p>
<p>What&#8217;s interesting about ActiveJDBC is how little baggage it brings with it, and how quickly one can get started using it.  It&#8217;s pure Java, requires few other libraries (no Hibernate, JPA, etc), and requires no configuration (no mapping, etc).  All metadata is inferred from the database schema.</p>
<p>Some examples of ActiveJDBC in action:</p>
<p><strong>Persistent Book class definition:</strong></p>
<pre class="brush: java; title: ; notranslate">
import activejdbc.Model;

public class Book extends Model {}
</pre>
<p><strong>Adding a new Book:</strong></p>
<pre class="brush: java; title: ; notranslate">
Book b = new Book();
b.set(&quot;isbn&quot;, &quot;0321127420&quot;)
  .set(&quot;title&quot;, &quot;Patterns of Enterprise Application Architecture&quot;)
  .set(&quot;author&quot;, &quot;Martin Fowler&quot;)
  .set(&quot;publisher&quot;, &quot;Addison-Wesley Professional&quot;);
b.saveIt();
</pre>
<p><strong>Paging through Addison-Wesley books in sorted order</strong></p>
<pre class="brush: java; title: ; notranslate">
List&lt;Book&gt; books = Book.where(&quot;publisher = ?&quot;, &quot;&quot;Addison-Wesley Professional&quot;);
  .offset(11)
  .limit(10)
  .orderBy(&quot;author asc&quot;);
</pre>
<p>It looks like this framework strikes a good balance between a simple framework that works as you expect, and providing an elegant DSL for database access.  This is particularly impressive given Java as a language doesn&#8217;t lend itself to implementing DSLs.</p>
<p>One thing I was curious about but didn&#8217;t see an example of, was working with associations, which is listed on the features page.</p>
<p>For more info, see the <a title="Getting Started Guide" href="http://code.google.com/p/activejdbc/wiki/GettingStarted">Getting Started Guide</a> on Google Code, <a href="http://igorpolevoy.blogspot.com/">Igor&#8217;s blog</a>, and the <a href="http://www.productiveedge.com/java/">Productive Edge Java</a> blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2010/07/activejdbc-activerecord-for-java/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Scala for something I&#8217;d normally using a &#8220;scripting&#8221; language for</title>
		<link>http://rpstechnologies.net/ron/blog/2010/01/using-scala-for-something-id-normally-using-a-scripting-language-for/</link>
		<comments>http://rpstechnologies.net/ron/blog/2010/01/using-scala-for-something-id-normally-using-a-scripting-language-for/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 05:21:13 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/2010/01/using-scala-for-something-id-normally-using-a-scripting-language-for/</guid>
		<description><![CDATA[From time to time, some repetitive task comes up that I can do quicker by writing a script to do it than to do it manually. Especially if it&#8217;s something I may be needing to do again in the future. &#8230; <a href="http://rpstechnologies.net/ron/blog/2010/01/using-scala-for-something-id-normally-using-a-scripting-language-for/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>From time to time, some repetitive task comes up that I can do quicker by writing a script to do it than to do it manually. Especially if it&#8217;s something I may be needing to do again in the future.</p>
<p>Usually I&#8217;d turn to a &#8220;scripting&#8221; language like Python, Groovy, or back in the day, Perl for this type of thing.</p>
<p>Today such a need came up, and I decided to try tackling it with Scala since it has many of the features that make the above dynamic languages good for this:</p>
<ul>
<li>first-class support for map and list data structures</li>
<li>an interactive shell</li>
<li>minimal overhead to write a program, compile, and run it</li>
<li>support for functional programming</li>
<li>good regular expression support</li>
</ul>
<p>The problem:<br />
A small performance test program ran a large number of tests, and measured the elapsed time for each execution. The program output a line like &#8220;request completed in 10451 msecs&#8221; for each test. I needed to parse the output, collect the elapsed time measurements, and get some basic statistics on them; simple average, minimum, and maximum.</p>
<p>I used a Scala 2.8 snapshot, and fleshed out the code using the Scala interactive shell. First, define a value with the raw output to be processed:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
scala&gt; val rawData = &quot;&quot;&quot;request completed in 10288 msecs
     | request completed in 10321 msecs
     | request completed in 10347 msecs
     | request completed in 10451 msecs
     | request completed in 10953 msecs
     | request completed in 11122 msecs
... hundreds of lines ...
     | request completed in 11672 msecs&quot;&quot;&quot;
</pre>
<p>The above uses Scala&#8217;s support for <a href="http://langref.org/scala/strings/declaring-strings/multiline">multi-line string literals</a>.</p>
<p>The next thing I needed to do was parse the above output, using a regular expression to extract just the milliseconds. There&#8217;s several ways to create a regular expression in Scala. This is the one I like:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">val ReqCompletedRE = &quot;&quot;&quot;\s*request completed in (\d+) msecs&quot;&quot;&quot;r
</pre>
<p>There&#8217;s a bit of magic in how the above string literal actually ends up becoming a regular expression.  There&#8217;s an <a href="http://www.scala-lang.org/node/130">implicit conversion</a> in the Scala <a href="http://www.scala-lang.org/docu/files/api/scala/Predef$object.html">Predef object</a> which turns a Java String into a RichString. RichString provides a &#8216;r&#8217; method that returns a regular expression object. The members of the Predef object are automatically imported into every Scala module, so the Scala compiler will attempt to apply any conversions it finds in Predef when trying to resolve the &#8216;r&#8217; method. So the above expression is creating a RichString from a String via an implicit conversion, then calling the &#8216;r&#8217; method on it, which returns the regular expression.</p>
<p>To apply the regular expression to a line of the output and to extract the milliseconds, we can use an expression like:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">scala&gt; val ReqCompletedRE(msecs) = &quot; request completed in 10451 msecs&quot;
msecs: String = 10451
</pre>
<p>msecs gets bound to the first group in the regular expression (the part that matches (\d+)).  This takes place via the <a href="http://www.scala-lang.org/node/112">Scala extractors</a> feature &#8211; the scala <a href="http://www.scala-lang.org/docu/files/api/scala/util/matching/Regex.html">regular expression class</a> defines an extractor which extracts the grouping results.</p>
<p>The next step is to iterate over the lines of the output, extract the milliseconds, and turn the results into a list.</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">scala&gt; val msecsVals = rawData.lines.map { line =&gt; val ReqCompletedRE(msecs) = line; Integer.parseInt(msecs);} toList
res11: List[Int] = List(10288, 10321, 10347, 10451, 10953, 11122, ..., 11672)
</pre>
<p>The above code is using the <a href="http://www.scala-lang.org/docu/files/api/scala/runtime/RichString.html#lines">RichString lines</a>, <a href="http://www.scala-lang.org/docu/files/api/scala/Iterator.html#map%28%28A%29%3D%3EB%29">Iterator.map method</a>, along with Scala closures.</p>
<p>Finally, to get the simple statistics:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">scala&gt; (msecsVals.sum / msecsVals.length, msecsVals.min, msecsVals.max)
res21: (Int, Int, Int) = (10736,10288,11672)
</pre>
<p>Putting the whole script together:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">val ReqCompletedRE = &quot;&quot;&quot;\s*request completed in (\d+) msecs&quot;&quot;&quot;r
val msecsVals = rawData.lines.map { line =&amp;amp;amp;gt; val ReqCompletedRE(msecs) = line; Integer.parseInt(msecs);} toList
(msecsVals.sum / msecsVals.length, msecsVals.min, msecsVals.max)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2010/01/using-scala-for-something-id-normally-using-a-scripting-language-for/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New change management tool: Redmine</title>
		<link>http://rpstechnologies.net/ron/blog/2009/11/new-change-management-tool-redmine/</link>
		<comments>http://rpstechnologies.net/ron/blog/2009/11/new-change-management-tool-redmine/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 04:53:02 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/2009/11/new-change-management-tool-redmine/</guid>
		<description><![CDATA[I was starting a new project, needed a change management tool, and wasn&#8217;t really satisfied with the tools available last time I looked, so I took a look at what was currently available.&#160; One option I came across that hadn&#8217;t &#8230; <a href="http://rpstechnologies.net/ron/blog/2009/11/new-change-management-tool-redmine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was starting a new project, needed a change management tool, and wasn&#8217;t really satisfied with the tools available <a href="http://rpstechnologies.net/ron/blog/2008/05/change-management-and-bug-tracking/">last time I looked</a>, so I took a look at what was currently available.&nbsp; One option I came across that hadn&#8217;t been on my radar before was <a href="http://www.redmine.org/">Redmine</a>.</p>
<p>Redmine has many of the features I like from <a href="http://trac.edgewall.org/">Trac</a>, such as the Roadmap view, version control integration, an Activity view, and built in Wiki.&nbsp; It also has a bunch of <a href="http://www.redmine.org/wiki/redmine/Plugin_List">plugins</a>, <a href="http://www.redmine.org/wiki/redmine/PluginCharts">one of which</a> looks like it&#8217;ll generate burndown charts, which I&#8217;m planning to use.</p>
<p>It looked like Redmine was fairly well supported on Windows (box I have available) so I decided to try it out.&nbsp; Redmine is based on Ruby on Rails, so the first step to <a href="http://www.redmine.org/wiki/redmine/RedmineInstall">installation</a> is to get Ruby and Rails installed.</p>
<p>I started off trying to install Ruby and Rails under cygwin, but ran into problems with building mysql from source (no cygwin port for this!).</p>
<p>So instead I went down the route of installing everything outside of cygwin.&nbsp; Here&#8217;s a summary of the steps:
<ul>
<li>Install the <a href="http://rubyforge.org/frs/?group_id=167">Windows Ruby binary</a>, along with Gem package system.</li>
<p>
<li>Install the Rails 2.1.2 gem, which Redmine 0.8.X depends on</li>
<p>
<li>Download and unpack the Redmine <a href="http://rubyforge.org/frs/?group_id=1850">distribution</a></li>
<p>
<li>Setup the database (running on MySQL in my case) and edit database.yml per <a href="http://www.redmine.org/wiki/redmine/RedmineInstall#Database">instructions</a>.</li>
<p>
<li>I had to install older MySQL client library due to some Rails/MySQL library incompatibility (described <a href="http://forums.aptana.com/viewtopic.php?f=20&amp;t=7563&amp;p=27407&amp;hilit=libmysql.dll#p27407">here</a>)</li>
<p>
<li>Create the database schema for Redmine via:
<pre class="brush: bash; gutter: false; title: ; notranslate">rake redmine:load_default_data RAILS_ENV=&amp;amp;quot;production&amp;amp;quot;</pre>
</li>
<p>
<li>Populate a default configuration via:
<pre class="brush: bash; gutter: false; title: ; notranslate">rake redmine:load_default_data RAILS_ENV=&amp;amp;quot;production&amp;amp;quot;</pre>
</li>
<p>
<li>You can then run Redmine via: 
<pre class="brush: bash; gutter: false; title: ; notranslate">ruby script/server webrick -e production</pre>
</li>
<p></ul>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=9b481db7-b423-82f1-b1e3-514062399571" /></div>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2009/11/new-change-management-tool-redmine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scala, Maven and IntelliJ</title>
		<link>http://rpstechnologies.net/ron/blog/2009/10/maven-scala-and-intellij/</link>
		<comments>http://rpstechnologies.net/ron/blog/2009/10/maven-scala-and-intellij/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 03:44:46 +0000</pubDate>
		<dc:creator>ron</dc:creator>
				<category><![CDATA[Scala]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://rpstechnologies.net/ron/blog/2009/10/maven-scala-and-intellij/</guid>
		<description><![CDATA[I&#8217;m evaluating Scala for a project I&#8217;ve recently started.  The project requires processing a large number of data structures.  Between Scala&#8217;s good support for parallelism and functional programming, it seems like a good fit.  I&#8217;ve heard Scala brings many of &#8230; <a href="http://rpstechnologies.net/ron/blog/2009/10/maven-scala-and-intellij/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m evaluating Scala for a project I&#8217;ve recently started.  The project requires processing a large number of data structures.  Between Scala&#8217;s good support for parallelism and functional programming, it seems like a good fit.  I&#8217;ve heard Scala brings many of the development efficiencies and expressiveness of dynamic languages, while being statically typed.  It does this through a number of features, including smart type inferencing, great functional programming support, traits, and a bunch of other tricks I&#8217;m in the process of learning.</p>
<p>We&#8217;ve seen several dynamically typed languages gain widespread adoption in the last eight years or so&#8230; Python, Ruby, Groovy, and you can go back to Javascript, Perl, PHP, etc..  What&#8217;s the last statically typed language that&#8217;s gained a wide following?  C#?  I&#8217;ve pretty much come to assume that any new language that was highly expressive, concise, and good for DSLs, would be a dynamic language.  Dynamic languages do have their drawbacks..  performance is usually not up to par with statically typed languages (although it rarely makes a difference), and the lack of type information at compile type make it very difficult for IDEs to provide features such as autocomplete, symbol lookup, and early error detection.  So if languages such as Scala manage to deliver a highly development-efficient language while retaining static typing, that&#8217;s all the better in my eyes.</p>
<p>Here&#8217;s what I did to get a minimal project set up in Maven and IntelliJ IDEA:</p>
<p>Create a shell of a project using a Maven archetype:</p>
<pre class="brush: bash; gutter: false; title: ; notranslate">
mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create \
-DarchetypeGroupId=org.scala-tools.archetypes \
-DarchetypeArtifactId=scala-archetype-simple \
-DarchetypeVersion=1.1 \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=com.rps -DartifactId=scalatest
</pre>
<p>This created a project with a single Scala class, test, and a Maven POM containing the minimal dependencies and plugins.</p>
<p>The version of Scala generated by the archetype isn&#8217;t the most current.  Just update the version in the POM:</p>
<pre class="brush: xml; gutter: false; title: ; notranslate">&lt;scala.version&gt;2.6.1&lt;/scala.version&gt;</pre>
<p>to 2.7.6, or whatever is the version you want.</p>
<p>I then imported the project into IntelliJ IDEA using the excellent IDEA Maven integration.  I had to add the Scala nature to the project in IDEA myself, but otherwise, everything is working..  Editing, unit tests, debugging, etc.</p>
<p>The IntelliJ IDEA editor support for autocomplete seems to work pretty well, but it doesn&#8217;t seem to do much detection of errors as you&#8217;re editing yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://rpstechnologies.net/ron/blog/2009/10/maven-scala-and-intellij/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

