<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1.2" -->
<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/"
	>

<channel>
	<title>Software Development &#038; Beyond</title>
	<link>http://www.mortench.net/blog</link>
	<description>A blog mostly about my ongoing experiences in the software R&#038;D business</description>
	<pubDate>Sun, 09 Sep 2007 15:52:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.2</generator>
	<language>en</language>
			<item>
		<title>New company 41concepts, New blogs</title>
		<link>http://www.mortench.net/blog/2007/09/09/new-company-new-blogs/</link>
		<comments>http://www.mortench.net/blog/2007/09/09/new-company-new-blogs/#comments</comments>
		<pubDate>Sun, 09 Sep 2007 15:49:09 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2007/09/09/new-company-new-blogs/</guid>
		<description><![CDATA[I have been busy, busy, busy lately with our new IT startup 41concepts.  41concepts is a Danish software development company offering premium consultancy services in software development - primarily with the established Microsoft .NET and Java/JEE platforms. In addition we are working on several yet to be announced web projects based on the revolutionary [...]]]></description>
			<content:encoded><![CDATA[<p>I have been busy, busy, busy lately with our new IT startup <a href="http://www.41concepts.com" title="41concepts">41concepts</a>.  <a href="http://www.41concepts.com" title="41 concepts"><span class="name">41concepts</span></a> is a Danish software development company offering premium consultancy services in software development - primarily with the established <a href="http://msdn.microsoft.com/">Microsoft .NET</a> and <a href="http://java.sun.com/">Java/JEE</a> platforms. In addition we are working on several yet to be announced web projects based on the revolutionary <a href="http://www.rubyonrails.com">Ruby on Rails</a> web framework.</p>
<p>In other words, <em>this blog will be discontinued</em>&#8230; Stay tuned on our new <a href="http://techblog.41concepts.com">software development blog</a> on <a href="http://techblog.41concepts.com/">techblog.41concepts.com</a> (english) or our business startup blog on <a href="http://bizblog.41concepts.dk/">bizblog.41concepts.dk</a> (danish).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2007/09/09/new-company-new-blogs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rails, Stored Procedures, Migrations, Mysql 5+ and &#8230; Trouble!</title>
		<link>http://www.mortench.net/blog/2007/03/31/rails-stored-procedures-migrations-mysql-5-and-trouble/</link>
		<comments>http://www.mortench.net/blog/2007/03/31/rails-stored-procedures-migrations-mysql-5-and-trouble/#comments</comments>
		<pubDate>Sat, 31 Mar 2007 15:13:35 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Ruby On Rails]]></category>

		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2007/03/31/rails-stored-procedures-migrations-mysql-5-and-trouble/</guid>
		<description><![CDATA[This is a tale about Ruby On Rails, custom stored procedures for MySql 5 and how Rails 1.2.3 is not only opinionated against stored procedures but also actually incompatible with creating and sometimes calling (mysql) stored procedures. The tales does not end with a truly happy ending but some &#8220;hacks&#8221; are mentioned that I have [...]]]></description>
			<content:encoded><![CDATA[<p>This is a tale about <a href="http://www.rubyonrails.com/">Ruby On Rails</a>, custom stored procedures for <a href="http://www.mysql.com/" title="MySQL">MySql 5</a> and how Rails 1.2.3 is not only opinionated against stored procedures but also actually incompatible with creating and sometimes calling (mysql) stored procedures. The tales does not end with a truly happy ending but some &#8220;hacks&#8221; are mentioned that I have found useful.</p>
<p><strong>Background</strong><br />
The rails framework developers, being of the opinion that complexity is best located in the code and not in the database, does not advocate using stored procedures as a abstraction layer between the database and the application. Instead dynamic sql generated from RoR code is used. For typical application databases, this approach works very well indeed.</p>
<p>Examples where the traditional rails way of database thinking sometimes fails short are projects involving multiple (some non-rails) applications, projects involving legacy databases, projects where the lifetime of the data will exceed the life of the application code and finally specialized projects where a non-trivial amount of handcrafted sql code is needed (typically for reporting, statistical analysis, data mining, scheduled database maintenance tasks and other sql that are not related to the O-R mapping handled by ActiveRecord).</p>
<p>For the latter cases, some usage of stored procedures together with the rest of the traditional database arsenal (foreign key constrains (*), Triggers, views etc) can be useful at times&#8230; all depending on the specific project needs of cause.</p>
<p><em>(*) Actually, from experience, I highly recommend always defining foreign key constrains (even in &#8220;application&#8221; databases). This is sadly NOT the current way of thinking among rails developers and consequently rails support is lacking - but that is another story.</em></p>
<p><strong>Defining stored procedures in MySql</strong></p>
<p>Since version 5 of the MySql database you can define a simple no-arg stored procedure like this:</p>
<blockquote><p>DELIMITER $$</p>
<p>CREATE PROCEDURE mydb.my_stored_procedure()<br />
BEGIN<br />
&#8211; INSERT CODE HERE<br />
END $$</p>
<p>DELIMITER ;</p></blockquote>
<p>Notice the importance of overriding the default &#8220;;&#8221; delimiter when defining your typical stored procedure! This is different from creating stored procedure in Sql Server for instance.</p>
<p><strong>Calling stored procedures from Rails:</strong></p>
<p>Begin by upgradÃ­ng your standard ruby mysql driver to the native &#8220;C&#8221; driver (gem install mysql) as the standard pure-ruby mysql driver doesn&#8217;t support all the needed MySql 5 features.</p>
<p>From rails, our MySQL procedure can f.x. be called using execute(&#8221;<strong>CALL my_stored_procedure</strong><strong>()</strong>&#8220;) in a migration . Unfortunately, it might not always work. If your stored procedure return multiple result sets, calling the procedure will fail unless you pass the <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html">Mysql::CLIENT_MULTI_RESULTS flag</a> when establishing the database connection. Unfortunately, active record does not allow specifying client flags for your database connection. For workaround instructions, that involve patching the MySql Adaptor, see <a href="http://wiki.rubyonrails.org/rails/pages/StoredProceduresInMySql">the wiki entry here</a> or the outdated <a href="http://dev.rubyonrails.org/ticket/5260">bug report with patch here</a>.</p>
<p><strong>Creating your stored procedures in rails migrations:</strong></p>
<p>The brave adventurer may try to create a Mysql 5 stored procedures like this in a rails migration:</p>
<blockquote><p>class CreateDatabaseObjects &lt; ActiveRecord::Migration</p>
<p>def self.up<br />
sql_directory = File.join(File.dirname(__FILE__), &#8220;sql&#8221; )</p>
<p>begin<br />
f=File.open(File.join(sql_directory, &#8220;my_stored_procedure.sql&#8221;), &#8220;r&#8221;)<br />
sql = f.readlines.join<br />
execute(sql)<br />
ensure<br />
f.close unless f==nil<br />
end<br />
end</p>
<p>def self.down<br />
execute &#8220;DROP PROCEDURE my_stored_procedure&#8221;<br />
end</p>
<p>end</p></blockquote>
<p>Unfortunately, I have found that the obvious approach above does not work with the newest stable version of ruby 1.8.6 and rails 1.2.3 on my Windows installation (meaningless error). Hacking the MySql Adaptor to include the <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html">Mysql::CLIENT_MULTI_STATEMENTS client flag</a> does not improve the situation (which is rather strange).</p>
<p>However, I did succeed in creating a workaround. Not a pretty hack or a truely happy resolution but it works:</p>
<blockquote><p>class CreateDatabaseObjects &lt; ActiveRecord::Migration</p>
<p>def self.up<br />
sql_directory = File.join(File.dirname(__FILE__), &#8220;sql&#8221; )</p>
<p># Hack: Invoke database cmd tool subprocess to create our mysql stored procedure.<br />
conf = ActiveRecord::Base.configurations[RAILS_ENV]<br />
sql_file = File.join(sql_directory, &#8220;my_stored_procedure.sql&#8221;)<br />
cmd_line=&#8221;mysql -h &#8220;+conf[&#8221;host&#8221;]+&#8221; -D &#8220;+conf[&#8221;database&#8221;]+ &#8221; -u &#8220;+conf[&#8221;username&#8221;]+&#8221; -p&#8221;+conf[&#8221;password&#8221;]+&#8221; &lt;&#8221;+sql_file<br />
if !system(cmd_line)<br />
raise Exception, &#8220;Error executing &#8220;+cmd_line<br />
end</p>
<p>end</p>
<p>def self.down<br />
execute &#8220;DROP PROCEDURE my_stored_procedure&#8221;<br />
end</p>
<p>end</p></blockquote>
<p>- The end -</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2007/03/31/rails-stored-procedures-migrations-mysql-5-and-trouble/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Danes On Rails</title>
		<link>http://www.mortench.net/blog/2006/09/09/danes-on-rails/</link>
		<comments>http://www.mortench.net/blog/2006/09/09/danes-on-rails/#comments</comments>
		<pubDate>Fri, 08 Sep 2006 22:59:33 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/09/09/danes-on-rails/</guid>
		<description><![CDATA[Danish companies tend to be on the conservative side when it comes to new technology, despite all benefits. So was the case 10 years ago when I got started on the Java platform and so is the case now for Ruby / Ruby On Rails.
Therefore, if you are a software developer here in Denmark with [...]]]></description>
			<content:encoded><![CDATA[<p>Danish companies tend to be on the conservative side when it comes to new technology, despite all benefits. So was the case 10 years ago when I got started on the <a href="http://java.sun.com/">Java</a> platform and so is the case now for <a href="http://www.ruby-lang.org/en/">Ruby</a> / <a href="http://www.rubyonrails.com/">Ruby On Rails</a>.</p>
<p>Therefore, if you are a software developer here in Denmark with a strong interest in <a href="http://www.ruby-lang.org/en/">Ruby </a>/ <a href="http://www.rubyonrails.com/">RoR </a>you will currently find local work possibilities lacking (*). However, I expect this situation to change in the mid/long term so developers should get prepared (e.x: start you own <a href="http://www.rubyonrails.com/">RoR</a> / <a href="http://www.ruby-lang.org/en/">Ruby</a> projects, find foreign clients or do both like <a href="http://www.mortench.net">me</a> :-)).</p>
<p>One way that will help you get started is to join one of the new Danish <a href="http://www.rubyonrails.com/">RoR</a> / <a href="http://www.ruby-lang.org/en/">Ruby</a> user groups. The groups that I know of are:</p>
<p><a href="http://groups.google.com/group/aarhusrb">aarhus.rb</a> - Ruby/Rails user group situated in Ã…rhus. Meets at the start of every month at different locations hosted by members. Next meeting is 28. September 16.00-18.00, 2006 at MjÃ¸lner Informatics, Helsingforsgade 27, 8200 Ã…rhus N.. See the link for the associated google group.<br />
<a href="http://copenhagenrb.dk/"> Copenhagen.rb</a> - Ruby/Rails user group for greater Copenhagen area. Meets about every 1-2 months  at different locations hosted by members. Next meeting is 19. September, 17.30-?, 2006 at Kraftvaerk,  Vesterbrogade 74, 4. sal, 1620 KÃ¸benhavn V.. See link for details.</p>
<p><em>(* NOTE) If your (Danish) company do actually use Ruby / RoR or are interested in learning how to leverage the benefits, please let me know.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/09/09/danes-on-rails/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Do&#8217;s and Dont&#8217;s for exception handling</title>
		<link>http://www.mortench.net/blog/2006/08/08/dos-and-donts-for-exception-handling-or-what-every-developer-should-know-about-the-implementation-of-exception-handling/</link>
		<comments>http://www.mortench.net/blog/2006/08/08/dos-and-donts-for-exception-handling-or-what-every-developer-should-know-about-the-implementation-of-exception-handling/#comments</comments>
		<pubDate>Tue, 08 Aug 2006 20:04:26 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[.NET]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Cpp]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/08/08/dos-and-donts-for-exception-handling-or-what-every-developer-should-know-about-the-implementation-of-exception-handling/</guid>
		<description><![CDATA[&#8230; Or what every developer should know about the implementation of exception handling:
Modern Exception Handling (EH) in C++, JAVA, Ruby, Modular-3, C# and other modern programming languages is a great tool for handling errors but unfortunately it is sometimes abused by software developers that do not quite get what exceptions are really for or are [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&#8230; Or what every developer should know about the implementation of exception handling:</strong></p>
<p>Modern Exception Handling (EH) in C++, JAVA, Ruby, Modular-3, C# and other modern programming languages is a great tool for handling errors but unfortunately it is sometimes abused by software developers that do not quite get what exceptions are really for or are just ignorant of possible implementations.</p>
<p>Common abuses of EH includes using exceptions as an alternative flow control mechanism (think sophisticated &#8220;<span id="misp_compose_1" class="ms un" title="Click for suggested spellings">goto&#8217;s</span>&#8221; and you got the basic idea of this antipattern&#8221;)&#8230;&#8230;. Don&#8217;t do that. It will only make the code harder to read. It will also make your code slower to execute since throwing exceptions are generally very expensive operations.</p>
<p>Another less apparent misuse of EH is usage of try-catch(-finally), or similar constructions your language may offer, inside the control flow of <span id="misp_compose_2" class="ms un" title="Click for suggested spellings">hotspots</span> (such as inside time critical loops). Don&#8217;t do that, as a the try-catch-finally construction may have overhead even when you won&#8217;t expect it.</p>
<p>So why are throwing exceptions expensive and why may the try-catch-finally constructions (or similar) have overhead ? Well, it all depends on the language, the implementation of your VM or compiler (and sometimes on whether you use native code or not if your language allows it). Depending on your environment, just raising one exception can be from 10-100.000 times as slow as alternatively returning a simple return code from the method. And even if you don&#8217;t raise any exception, just having a try-catch-finally in your control flow can also be moderately expensive (but <span id="misp_compose_3" class="ms cr" title="Click for suggested spellings">usually</span> only enough to be a problem inside <span id="misp_compose_4" class="ms un" title="Click for suggested spellings">hotspots</span>).</p>
<p>Specifically, the case of overhead of try-catch-finally constructions when no exceptions occur is difficult to get rid of by compiler &#038; virtual-machine implementers. Few implementations on selected chip architecture got it right and have 100% overhead-free implementations but many impose a overhead just for placing try/catch/finally constructions in your control flow. Basically this is because something like a &#8220;linked list&#8221; has to be maintained internally by the compiler or <span id="misp_compose_5" class="ms un" title="Click for suggested spellings">VM</span> each time the control flow enters or exits a try-catch-finally.</p>
<p><em>For much more details about various possible implementations of exception handling and the impact on performance refer to this old thesis of mine <a href="http://www.mortench.net/archive/eh.pdf">here</a>.</em></p>
<p><strong>In conclusion, the morale of the story is:</strong><br />
* Do use exception handling for error handling only (not for control flow).<br />
* Don&#8217;t use try-catch-finally constructs inside hot-spots (i.e. loops and such) if it can be avoided. Do the try-catch at a higher level that is called less often.<br />
* If your particular java, c++, ruby, <span id="misp_compose_6" class="ms un" title="Click for suggested spellings">clr</span> &#8230; implementation of exception handling on one chip architecture yields excellent performance even when you break the above rules you are just plain lucky. Change the version, vendor or chip architecture and you luck may desert you. Therefore don&#8217;t do it <img src='http://www.mortench.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/08/08/dos-and-donts-for-exception-handling-or-what-every-developer-should-know-about-the-implementation-of-exception-handling/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Introducing CodeGenClipse and CodeGenJostraca</title>
		<link>http://www.mortench.net/blog/2006/06/10/13/</link>
		<comments>http://www.mortench.net/blog/2006/06/10/13/#comments</comments>
		<pubDate>Sat, 10 Jun 2006 14:53:56 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Java]]></category>

		<category><![CDATA[Eclipse]]></category>

		<category><![CDATA[Products]]></category>

		<category><![CDATA[CodeGenJostraca]]></category>

		<category><![CDATA[CodeGenClipse]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/05/23/13/</guid>
		<description><![CDATA[For my first Eclipse related posting on this blog, I would like to introduce two free Eclipse plugins just released this week. I will start with CodeGenJostraca that offers integration of the Jostraca code generator into the Eclipse v3.1.2+ IDE.

Why code generation?
I am a big believer in the DRY (Don’t Repeat Yourself) principle and believe [...]]]></description>
			<content:encoded><![CDATA[<p>For my first <a href="http://www.eclipse.org/">Eclipse</a> related posting on this blog, I would like to introduce two free <a href="http://www.eclipse.org/">Eclipse</a> plugins just released this week. I will start with <a href="http://codegenclipse.sourceforge.net/">CodeGenJostraca </a>that offers integration of the <a href="http://www.jostraca.org/">Jostraca </a>code generator into the <a href="http://www.eclipse.org/">Eclipse </a>v3.1.2+ IDE.</p>
<p><img align="middle" src="http://www.mortench.net/blog/myimages/codeGenClipse/screenshot.png" /></p>
<p><span style="font-weight: bold">Why code generation?</span><br />
I am a big believer in the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself">DRY (Don’t Repeat Yourself)</a> principle and believe that <a href="http://www.codegeneration.net/">code generation</a> is a great tool to help achieve it&#8217;s goal. More specifically I have found that code generation (when done right) helps me improve quality and save time &#038; effort by reducing redundancy and drudge work (especially for statically typed <a href="http://en.wikipedia.org/wiki/Programming_language">languages </a>like <a href="http://java.sun.com/">Java </a>or<a href="http://msdn.microsoft.com/vcsharp/language/"> C#</a> that I use a lot these days when doing <a href="http://www.mortench.net">consulting</a>).</p>
<p><span style="font-weight: bold">Why the Jostraca code generator?</span><br />
A year ago while evaluation existing <a href="http://www.codegeneration.net/">code generation tools</a>, I ended up with <a href="http://www.jostraca.org/">Jostraca,</a> a free <a href="http://www.gnu.org/copyleft/gpl.html">GPL </a>code generation tool written by <a href="http://www.richardrodger.com/">Richard Rodger</a>.</p>
<p><a href="http://www.jostraca.org/">Jostraca </a>is a template based generator that is based on extended <a href="http://java.sun.com/products/jsp">Java Server Pages</a> syntax. Notably, <a href="http://www.jostraca.org/">Jostraca </a>lets you use this syntax with multiple languages, including <a href="http://java.sun.com/">Java</a>, <a href="http://www.perl.com/">Perl</a>, <a href="http://www.python.org/">Python</a>, <a href="http://www.ruby-lang.org/">Ruby </a>etc. The output can be of any (textual) type including new source files for the project.</p>
<p>The <a href="http://www.jostraca.org/">Jostraca</a> template language is <strong>much </strong>more powerful than the language for the (<em>in eclipse circles</em>) well know <a href="http://www.eclipse.org/articles/Article-JET/jet_tutorial1.html">JET</a> generator, which I have personally found inadequate for my needs. For an example of one useful <a href="http://www.jostraca.org/">Jostraca</a> feature, that <a href="http://www.eclipse.org/articles/Article-JET/jet_tutorial1.html">JET</a> does not have, check the <a href="http://www.jostraca.org/">Jostraca </a>template extract below. It that shows how to declare a java template method called &#8220;formatThis&#8221;, that just like a macro, can be called from the normal generate method:</p>
<blockquote><p>&lt;%@ section declare %&gt;<br />
&lt;%private void formatThis(String name) {%&gt;<br />
&lt;%=name%&gt;<br />
&lt;%}%&gt;</p>
<p>&lt;%@ section generate %&gt;<br />
&lt;% formatThis( &#8220;foo&#8221; ); %&gt;</p></blockquote>
<p>For those that wonder about the implementation, the above extract gets translated to a temporary <a href="http://www.jostraca.org/doc/tut/codewriters.htm">codewriter</a> class that is executed in order to produce the actual output (similar to how <a href="http://java.sun.com/products/jsp/">JSP </a>translates into <a href="http://java.sun.com/products/servlet/">servlets </a>that are executed upon a <a href="http://en.wikipedia.org/wiki/HTTP">http request</a> in order to produce <a href="http://www.w3.org/MarkUp/">HTML</a>).</p>
<p><a href="http://www.jostraca.org/">Jostraca </a>has many more advanced features. Look at the <a href="http://www.jostraca.org/">Jostraca </a>code generator <a href="http://www.jostraca.org/documentation.htm">documentation </a>for details.<br />
<br style="font-weight: bold" /><span style="font-weight: bold">What CodeGenJostraca offers for your code generation needs</span><br />
<a href="http://codegenclipse.sourceforge.net/">CodeGenJostraca </a>allows you to create/edit your <a href="http://www.jostraca.org/">Jostraca </a>templates in the <a href="http://www.eclipse.org/">eclipse </a>editor. The plugin features a fully integrated (incremental) <a href="http://www.jostraca.org/">Jostraca </a>builder that generates output automatically when you save your template file and inserts the generated output directly into your project structure at a configurable location!</p>
<p>As such <a href="http://codegenclipse.sourceforge.net/">CodeGenJostraca </a>allows you to use codegeneration with a seamless build process just like working with normal source files (note this is very different from most other code generators, including <a href="http://www.eclipse.org/articles/Article-JET/jet_tutorial1.html">JET</a>, which requires you to perform special actions or even do some programming to produce your output).</p>
<p><a href="http://codegenclipse.sourceforge.net/">CodeGenJostraca </a>allows you to write your templates in any language supported by <a href="http://www.jostraca.org/">Jostraca</a>, including my favourite scripting languages <a href="http://www.ruby-lang.org/">Ruby </a>and <a href="http://www.python.org/">Python</a>!</p>
<p>However for the current release, <a href="http://java.sun.com/">Java </a>based templates have the best support regarding error handling, libraries and stability. One particular notable feature – absent for all other eclipse generator tools I have heard of  - is that the <a href="http://java.sun.com/">Java </a>templates can access all libraries and classes on the eclipse project path! I.e. you can have external libraries or helper classes in your project that gets called when <a href="http://www.jostraca.org/">Jostraca </a>is generating code while eclipse builds your project (note that using this feature will make your project depend on itself for building ; a bit like self hosting compilers).</p>
<p><span style="font-weight: bold">My business case or why I am releasing this project (for free)?</span><br />
I work as a <a href="http://www.mortench.net/">freelance software architect/developer</a> and also do some development on the side. I use code generation but it is not my current focus business wise.  Therefore, I am releasing this project as free <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a> code&#8230; So, if other developers can use this project that is fine. If some of you can come up with improvements even better <img src='http://www.mortench.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><span style="font-weight: bold">A word about the implementation and CodeGenClipse</span><br />
My ultimate aim is to offer support for multiple <a href="http://www.codegeneration.net/">code generators</a> as need arises, with <a href="http://www.jostraca.org/">Jostraca </a>being the initial focus. I have therefore released the project as two plugins:<br />
•    <a href="http://codegenclipse.sourceforge.net/">CodeGenClipse </a>: A generic <a href="http://www.eclipse.org/">Eclipse </a>plugin that provides a basic foundation for integrating code generators in <a href="http://www.eclipse.org/">Eclipse</a>. End users do not use this plugin in itself, but other plugins depends on it. This plugin is bundled with the plugin below.<br />
•    <a href="http://codegenclipse.sourceforge.net/">CodegenJostraca </a>: An <a href="http://www.eclipse.org/">Eclipse </a>plugin that offers integration of the <a href="http://www.jostraca.org/">Jostraca </a>code generator into the <a href="http://www.eclipse.org/">Eclipse </a>IDE. This plugin is targeted towards end users and the principal subject of this posting.</p>
<p><span style="font-weight: bold">Notes &#038; disclaimers<br />
</span>Note that this is a beta release that has been tested under <a href="http://www.eclipse.org/">Eclipse </a>3.1.2 and <a href="http://www.eclipse.org/">Eclipse </a>3.2RC5 running JDK1.5_06 under Windows XP. <strong>It requires <a href="http://java.sun.com/j2se/1.5.0/download.jsp">JDK1.5</a></strong>! It has NOT been tested on Unix/Linux/Mac so far. It runs stable on the few PC&#8217;s I use but that is all I can assure you of right now. Note also that of the many scripting languages supported by <a href="http://www.jostraca.org/">Jostraca</a>, only <a href="http://java.sun.com/">Java</a>, <a href="http://www.ruby-lang.org/">Ruby </a>and <a href="http://www.python.org/">Python </a>has been tested so far.<br />
In addition plugin developers interested in supporting other code generators should be aware that the <a href="http://codegenclipse.sourceforge.net/">CodeGenClipse</a> plugin is a bit rough right now and the API is not stable yet.</p>
<p><span style="font-weight: bold">More information</span><br />
See the project homepage <a href="http://codegenclipse.sourceforge.net">http://codegenclipse.sourceforge.net/</a> or the <a href="http://sourceforge.net/projects/codegenclipse">sourceforge project site</a>. Alternatively contact me directly (see my <a href="http://www.mortench.net/">homepage </a>for details).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/06/10/13/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Linux: &#8220;Fair and balanced&#8221; :-)</title>
		<link>http://www.mortench.net/blog/2006/06/04/linux-fair-and-balanced/</link>
		<comments>http://www.mortench.net/blog/2006/06/04/linux-fair-and-balanced/#comments</comments>
		<pubDate>Sun, 04 Jun 2006 14:20:30 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Windows]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Humor]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/06/04/linux-fair-and-balanced/</guid>
		<description><![CDATA[On the blog shelleytherepublican one can find an entertaining treasure of &#8220;fair and balanced&#8221; viewpoints on Linux (and Windows). For example one can read an article stating that Linux is a threat to America , an &#8220;unbiased&#8221; comparison of Linux vs Windows or even an excuse about the fact that the site was/is hosted on [...]]]></description>
			<content:encoded><![CDATA[<p>On the blog <em>shelleytherepublican</em> one can find an entertaining treasure of <a href="http://shelleytherepublican.com/index.php?s=linux&#038;sbutt=Go">&#8220;fair and balanced&#8221; viewpoints on Linux</a> (and Windows). For example one can read an article stating that <a href="http://shelleytherepublican.com/2006/04/20/linux-a-european-threat-to-our-computers-by-tristan.aspx">Linux is a threat to America</a> , an &#8220;unbiased&#8221; <a href="http://shelleytherepublican.com/2006/05/03/linux-and-windows-compared-the-facts.aspx">comparison of Linux vs Windows</a> or even an <a href="http://shelleytherepublican.com/2006/05/02/shelleytherepublicancom-hosted-on-linux.aspx">excuse</a> about the fact that the site was/is hosted on Linux <img src='http://www.mortench.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
P.S. Read this <a href="http://en.wikipedia.org/wiki/Shelley_the_Republican">wiki article</a> if you are unsure about the true nature of <em>Shelley</em> and her satirical(!) site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/06/04/linux-fair-and-balanced/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby on Rails studio alumni</title>
		<link>http://www.mortench.net/blog/2006/05/16/ruby-on-rails-studio-alumni/</link>
		<comments>http://www.mortench.net/blog/2006/05/16/ruby-on-rails-studio-alumni/#comments</comments>
		<pubDate>Tue, 16 May 2006 21:17:34 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Ruby On Rails]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/05/16/ruby-on-rails-studio-alumni/</guid>
		<description><![CDATA[I just completed a great training course for Ruby On Rails (RoR), a revolutionary framework for web developing. The course was in Boston (MA) and was held by the authors of the notable book Agile Web Development with Rails.
I personally have quite some experience with &#8216;traditional&#8217; web development using ASP.NET and J2EE. Having experimented with [...]]]></description>
			<content:encoded><![CDATA[<p><span lang="EN-GB">I just completed a great training course for <a href="http://www.rubyonrails.org/">Ruby On Rails</a> (RoR), a revolutionary framework for web developing. The course was in Boston (MA) and was held by the authors of the notable book <a href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=as2&#038;path=ASIN/097669400X&#038;tag=softwardevelo-21&#038;camp=1634&#038;creative=6738">Agile Web Development with Rails</a>.</span></p>
<p>I personally have quite some experience with &#8216;traditional&#8217; web development using ASP.NET and J2EE. Having experimented with RoR myself and gone through additional training, I can now say for sure that RoR is definitely easier and more productive than these (and at the same time making it easy to get great quality and maintainability). RoR also compares very favourably against PHP according to the many PHP developers I meet during the course.</p>
<p><span lang="EN-GB">According to the guys behind the Rails Studio training course for Ruby On Rails: &#8220;Nothing says &#8216;I&#8217;m ready to write killer Rails apps&#8217; better than a Rails Studio alumni button&#8221;. So here is the button I got:</span></p>
<div style="text-align: center"><img src="http://www.mortench.net/blog/myimages/alumni_stamp.png" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/05/16/ruby-on-rails-studio-alumni/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Breaking encapsulation with C# 2.0 partial classes</title>
		<link>http://www.mortench.net/blog/2006/05/03/breaking-encapsulation-with-c-20-partial-classes/</link>
		<comments>http://www.mortench.net/blog/2006/05/03/breaking-encapsulation-with-c-20-partial-classes/#comments</comments>
		<pubDate>Wed, 03 May 2006 20:37:48 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[.NET]]></category>

		<category><![CDATA[C#]]></category>

		<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/05/03/breaking-encapsulation-with-c-20-partial-classes/</guid>
		<description><![CDATA[For good or bad partial classes in C# 2.0 allows breaking of encapsulation as this example will show.
In a consulting job I recently ran into an interesting case involving a webservice with several different service methods f1, f2, fn (sample names, not actual names) all taking the same string argument and all returning a string. [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span lang="EN-GB" style="font-size: 10pt">For good or bad <a href="http://en.wikipedia.org/wiki/Partial_type">partial classes</a> in C# 2.0 allows breaking of encapsulation as this example will show.</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size: 10pt">In a consulting job I recently ran into an interesting case involving a webservice with several different service methods f1, f2, fn <em>(sample names, not actual names)</em> all taking the same string argument and all returning a string. The user would select an operation name after which my code had to call the named operation on a web service using a standard parameter. Trivial really, if one would do accept bad code like this below, but I don&#8217;t:</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size: 10pt"> </span></p>
<p><code> </code></p>
<p align="left" class="MsoNormal"><em><span lang="EN-GB" style="font-size: 10pt">String operationName = &#8230;<br />
String arg = &#8230;<br />
Webserviceproxy webserviceproxy = &#8230;<br />
// Warning: Badly coupled code begins here (need to update each time we add/rename/delete operations).<br />
switch (operationName) {<br />
case &#8220;f1&#8243;: return webserviceproxy.f1(arg); break;<br />
case &#8220;f2&#8243;: return webserviceproxy.f2(arg); break;<br />
}</span></em>
</p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size: 10pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size: 10pt">What is really needed is a method to invoke a webservice method by name, while still using the generated .NET proxy to do the hard soap/http stuff (no time to reinvent a better wheel here).</span></p>
<p><span lang="EN-GB" style="font-size: 10pt">Let&#8217;s look at an extract of the generated proxy:</span>
</p>
<p class="MsoNormal">
<p> <a href="http://www.mortench.net/blog/2006/05/03/breaking-encapsulation-with-c-20-partial-classes/#more-10" class="more-link">(more&#8230;)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/05/03/breaking-encapsulation-with-c-20-partial-classes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Starting Out (again)</title>
		<link>http://www.mortench.net/blog/2006/03/31/starting-out-again/</link>
		<comments>http://www.mortench.net/blog/2006/03/31/starting-out-again/#comments</comments>
		<pubDate>Fri, 31 Mar 2006 18:12:51 +0000</pubDate>
		<dc:creator>mortench</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mortench.net/blog/2006/03/31/starting-out-again/</guid>
		<description><![CDATA[Welcome to my new blog. I intend to use this space to write a bit about my ongoing experiences and interests in the software R&#038;D business&#8230;. Morten Mikael Christensen, AArhus, DK
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mortench.net/"><img align="left" src="http://www.mortench.net/blog/myimages/bcard_128_sp.jpg" /></a>Welcome to my new <a href="http://www.mortench.net/blog/about/">blog</a>. I intend to use this space to write a bit <a href="http://www.mortench.net/blog/about/">about</a> my ongoing experiences and interests in the software R&#038;D business&#8230;.<em> Morten Mikael Christensen, AArhus, DK</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mortench.net/blog/2006/03/31/starting-out-again/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
