<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-30004545</id><updated>2011-12-14T15:45:12.633+01:00</updated><category term='deployment'/><category term='GDT'/><category term='Spring Rails Burlap Ruby'/><category term='agile'/><category term='Mac productivity news'/><category term='datamapper'/><category term='Merb'/><category term='development'/><category term='Rails'/><title type='text'>creative source</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-30004545.post-4005748224491718113</id><published>2009-05-17T22:01:00.001+02:00</published><updated>2009-05-17T22:01:37.613+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>No Login after upgrade to Rails 2.3?</title><content type='html'>It cost me some hours on a sunday afternoon. After I upgraded to Rails 2.3.2 the login didnt work anymore. I read the &lt;a href="http://guides.rubyonrails.org/2_3_release_notes.html"&gt;release notes&lt;/a&gt; and followed all the instructions for cookie based sessions, like renaming session_key to key in the session config hash but still no luck. Things got more confused because locally everything worked fine. To make it short the solution is really very simple but you dont read much about it: you need to upgrade passenger to the newest version. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;gem install passenger &lt;br&gt;&lt;br /&gt;passenger-install-apache2-module&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;And dont forget to adjust your apache config with the new settings. These are generated by the installer so you can just copy them. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-4005748224491718113?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/4005748224491718113/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=4005748224491718113' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/4005748224491718113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/4005748224491718113'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2009/05/no-login-after-upgrade-to-rails-23.html' title='No Login after upgrade to Rails 2.3?'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-7917612766418483018</id><published>2009-01-11T21:37:00.001+01:00</published><updated>2009-01-11T21:37:53.817+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>switching to passenger</title><content type='html'>Though I am working with &lt;a href="http://www.modrails.com/"&gt;passenger&lt;/a&gt; for a while now, I just had new projects which started from the scratch using passenger. This week I switched my first mongrel based rails app to passenger. The idea was using passengers &lt;a href="http://www.modrails.com/documentation/Users%20guide.html#PassengerUseGlobalQueue"&gt;GlobalQueue&lt;/a&gt; option to optimize overall perfomance. One of the major mongrel drawbacks is its port based queues. If you have long running requests all others in the queue for that port have to wait. Thats different if you have just one global queue which doesnt pass request to busy processes. &lt;br&gt;&lt;br /&gt;While this works well as expected there are some minor modifications in the request header because the proxy has gone. For instance the webapplication  read the calling ip address with the HTTP_X_FORWARDED_FOR header info. This is empty now with passenger.&lt;br&gt;&lt;br /&gt;So instead of calling&lt;br /&gt;&lt;code&gt;&lt;br /&gt;request.env['HTTP_X_FORWARDED_FOR']&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;I had to use&lt;br /&gt;&lt;code&gt;&lt;br /&gt;request.env['REMOTE_ADDR']&lt;br /&gt;&lt;/code&gt; which has just the same info, the calling IP. &lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-7917612766418483018?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/7917612766418483018/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=7917612766418483018' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/7917612766418483018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/7917612766418483018'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2009/01/switching-to-passenger.html' title='switching to passenger'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-8115646180871428808</id><published>2008-10-31T22:25:00.004+01:00</published><updated>2008-11-01T21:39:10.412+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='datamapper'/><category scheme='http://www.blogger.com/atom/ns#' term='Merb'/><title type='text'>legacy databases with datamapper</title><content type='html'>For my current project I choose &lt;a href="http://www.datamapper.org"&gt;datamapper&lt;/a&gt; wich has some advantages over ActiveRecord. I need a thread safe ORM which doesnt need to do much but performing real fast. I am dealing with legacy table names but couldnt find any documentation how this is done though its very simple: &lt;br /&gt;&lt;br /&gt;Your model needs a method storage_name like : &lt;br /&gt;&lt;code&gt;&lt;br /&gt;def self.storage_name(repository)&lt;br /&gt;&amp;nbsp;&amp;nbsp;"your_legacy_table_name"&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;  &lt;br /&gt;Repository can be ignored if you are just dealing with one database. &lt;br /&gt;&lt;br /&gt;ps: &lt;a href="http://www.blogger.com/profile/00068697708128600397"&gt;afcool83&lt;/a&gt; mentioned a smarter way to do this: &lt;br /&gt;&lt;code&gt;&lt;br /&gt;storage_names[:default]='your_legacy_table_name'&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-8115646180871428808?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/8115646180871428808/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=8115646180871428808' title='2 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/8115646180871428808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/8115646180871428808'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/10/legacy-databases-with-datamapper.html' title='legacy databases with datamapper'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-5942516863925100957</id><published>2008-10-15T22:08:00.001+02:00</published><updated>2008-10-15T23:21:33.075+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='agile'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>the power of testing</title><content type='html'>I really thought we are over this point yet but it turns out to be a mistake. I work in a couple of projects in parallel so I meet a lot of developers and see many different types. I am really surprised to realize that the need to write tests still is so much underestimated. &lt;br /&gt;&lt;br /&gt;All the classics like "no time to write tests", "is it really worth the effort" to "I thought this is just a webapp, so there is no need to write tests". &lt;br /&gt;&lt;br /&gt;It happend to often too me, so here is my lesson learned if you start a new project with existing code. Ask for the tests. Take a peek a their test code, it gives you far more insight then any arbitrary code. It doesnt mean dont take any projects where no tests have been written, but it gives you different arguments. Its like dealing with legacy code, you cannot start implementing features as everything is fine. &lt;br /&gt;But if the project leaders dont realize this fact forget the project, its a death march. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To say it with Obie Fernandez &lt;a href="http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-Ruby/dp/0321445619/ref=pd_bbs_sr_1?ie=UTF8&amp;s=books&amp;qid=1224100931&amp;sr=8-1"&gt;words&lt;/a&gt; &lt;br /&gt;"Delivering Rails applications without automated test coverage is irresponsible and unprofessional."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-5942516863925100957?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/5942516863925100957/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=5942516863925100957' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/5942516863925100957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/5942516863925100957'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/10/power-of-testing.html' title='the power of testing'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-7049748269367972305</id><published>2008-09-21T00:39:00.001+02:00</published><updated>2008-09-21T00:39:56.994+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>620 Errors while testing with Google Geocoding</title><content type='html'>If you are using &lt;a href="http://code.google.com/apis/maps/documentation/services.html#Geocoding"&gt;Googles Geocoding Api&lt;/a&gt; you might experience occasional problems with 620 errors, especially while testing. The reason for this is Google prohibits too many calls in a short period. But for most testcases geocoding is not an issue so you should disable it for these. &lt;br /&gt;&lt;br /&gt;Fortunatly in Ruby its easy to override existing methods to mock them. I use the &lt;a href="http://geokit.rubyforge.org"&gt;geokit&lt;/a&gt; plugin and with it this could be done by the following method: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;def disable_geocoding&lt;br /&gt;    GeoKit::Geocoders::Geocoder.instance_eval do&lt;br /&gt;    	def geocode(a)&lt;br /&gt;    		res = GeoKit::GeoLoc.new&lt;br /&gt;    		res.lat = 13.423007&lt;br /&gt;    		res.lng = 52.534194&lt;br /&gt;    		res.success = true&lt;br /&gt;    		res&lt;br /&gt;    	end&lt;br /&gt;    end&lt;br /&gt;  end&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Include this in your testhelper and call disable_geocoding in your setup method. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-7049748269367972305?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/7049748269367972305/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=7049748269367972305' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/7049748269367972305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/7049748269367972305'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/09/620-errors-while-testing-with-google.html' title='620 Errors while testing with Google Geocoding'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-4472726296882334534</id><published>2008-08-04T13:06:00.005+02:00</published><updated>2008-08-05T01:42:54.696+02:00</updated><title type='text'>Annoying floating point conversion in Ruby</title><content type='html'>Try &lt;code&gt; (4.85*100).to_i &lt;/code&gt; in irb and you will get: &lt;br /&gt;&lt;code&gt;484&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This is weired and totaly unexpected for me. I understand that floating points are not accurate and conversions have their limits. Type &lt;code&gt;"%.32f" % 4.85&lt;/code&gt; and you see the real value of this float. The reason is that to_i does just a truncate. &lt;br /&gt;&lt;br /&gt;If you want the expected result you have to use:&lt;br /&gt; &lt;code&gt;(4.85*100).round&lt;/code&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-4472726296882334534?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/4472726296882334534/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=4472726296882334534' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/4472726296882334534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/4472726296882334534'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/08/annoying-floating-point-conversion-in.html' title='Annoying floating point conversion in Ruby'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-8603134684473832325</id><published>2008-07-18T09:43:00.010+02:00</published><updated>2008-07-18T09:58:04.036+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='GDT'/><title type='text'>Some GTD criticism</title><content type='html'>I believe in chaos. Not that I say I love it. We are all in it by nature. For me its not a fight against, its more a dealing with it. You can try to keep its entropy low but you always need creativity to deal with the unforseen. &lt;a href="http://en.wikipedia.org/wiki/Getting_Things_Done"&gt;GTD&lt;/a&gt; on the other hand is very strict and makes many assumptions. For me its hard to put all my tasks into one big pot and to decide when to write this or that task down for instance. GTD is sometimes too inflexible for certain situations. Sometimes projects need more attention, and they have much shorter cycles than less imortant or long running tasks. They grow bigger and they split or subprojects emerge and so on.&lt;br /&gt;I am sure I did not get everything &lt;a href="http://www.davidco.com/"&gt;Allen&lt;/a&gt; is saying us so I am misinterpreting one or the other point. But I mean, hey, this book is like a bible, and I dont like the idea you have to read the same book many times to get a simple thing.&lt;br /&gt;Dont get me wrong, I am still using GTD, not too dogmatic, as its fits and I am sattisfied with it. Good tools like &lt;a href="http://www.omnigroup.com/applications/omnifocus/"&gt;Omnifocus&lt;/a&gt; are a great help there. I am still experimenting with it but I think dealing with the habits is more important because they are the source when we did a failure. So for me GTD is just a small tool in a complex world ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-8603134684473832325?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/8603134684473832325/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=8603134684473832325' title='2 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/8603134684473832325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/8603134684473832325'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/07/some-gtd-criticism.html' title='Some GTD criticism'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-679193250170921569</id><published>2008-06-28T21:01:00.005+02:00</published><updated>2008-06-28T21:28:09.016+02:00</updated><title type='text'>Render a simple Javascript with Rails</title><content type='html'>Though its a simple task there is no well documented solution. Most I googled did not work. I just needed to write a large javascript array dynamicly. If you just do a &lt;code&gt;render :text =&gt; js&lt;/code&gt; your resulting content type will be text/html which was a problem for the IE. But setting the mime_type like &lt;p&gt;&lt;code&gt;render :text =&gt; js,:mime_type =&gt; Mime::Type.lookup("application/javascript")&lt;/code&gt;&lt;/p&gt;does not do the trick. What you have to do is setting the content type in the headers variable: &lt;p&gt;&lt;code&gt;headers["Content-Type"] = "text/javascript"&lt;/code&gt;. &lt;/p&gt;I got the best results when I also added a .js to the route so you can call it like a static javascriptfile. If you want to do more complicated things you may check out the &lt;a href="http://svn.danwebb.net/external/rails/plugins/minus_r/"&gt;minus_r&lt;/a&gt; plugin of &lt;a href="http://www.danwebb.net/"&gt;Dan Webb&lt;/a&gt;:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-679193250170921569?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/679193250170921569/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=679193250170921569' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/679193250170921569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/679193250170921569'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/06/render-simple-javascript-with-rails.html' title='Render a simple Javascript with Rails'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-3777055348706990472</id><published>2008-06-20T00:09:00.004+02:00</published><updated>2008-06-20T12:24:49.395+02:00</updated><title type='text'>Fat model</title><content type='html'>Today I had the chance to enjoy a dinner with David Black and some other Ruby folks in Berlin. We were discussing about legacy Rails code. Many newbies tend to write fat controllers with many pages of codes and 30 something methods. One was arguing that this is also Java style. I am now  thinking thats not prefered even in Java though it was engouraged in J2EE because Entity Beans had been such a crap. Its just functional programming style where you end when you dont understand object orientation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-3777055348706990472?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/3777055348706990472/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=3777055348706990472' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/3777055348706990472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/3777055348706990472'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/06/fat-model.html' title='Fat model'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-9107753141029803501</id><published>2008-06-16T01:11:00.005+02:00</published><updated>2008-06-16T01:25:56.304+02:00</updated><title type='text'>state of the art javascript gui</title><content type='html'>That gui of the &lt;a href="http://blog.280north.com/"&gt;north280&lt;/a&gt; guys is really awesome. you have got to check out their &lt;a href="http://280slides.com/Editor/"&gt;presentation tool&lt;/a&gt;. everything is so smooth, it doesnt look like a webgui. at least with my Safari. If you want to read about the background story and the developers tuaw has &lt;a href="http://www.tuaw.com/2008/06/15/wwdc-08-280-north/"&gt;more&lt;/a&gt;. hopefully they publish their javascript libraray objective-j &lt;a href="http://objective-j.org/"&gt;soon&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-9107753141029803501?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/9107753141029803501/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=9107753141029803501' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/9107753141029803501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/9107753141029803501'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/06/state-of-art-javascript-gui.html' title='state of the art javascript gui'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-3534236018296966122</id><published>2008-06-14T00:19:00.003+02:00</published><updated>2008-06-14T01:03:42.692+02:00</updated><title type='text'>Merb presentation</title><content type='html'>While I heard a lot of postive stuff about &lt;a href="http://merbivore.com/"&gt;merb&lt;/a&gt; I had no time to play with it, but &lt;a href="http://goruco2008.confreaks.com/06_zygmuntowicz.html"&gt;this presentation&lt;/a&gt; on confreaks is definitly worth seeing. Ezra Zygmuntowicz explains some of the advantages of merb. I like the idea of a hacker should understand his framework he is working with. Therefor no magic in the framework. The magic is for your code. What I found interesting as a Rails developer he also has some concrete critics at Rails, mainly at the Actionpack where he started refactoring some really old parts there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-3534236018296966122?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/3534236018296966122/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=3534236018296966122' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/3534236018296966122'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/3534236018296966122'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/06/merb-presentation.html' title='Merb presentation'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-4267601724650778679</id><published>2008-04-28T00:36:00.005+02:00</published><updated>2008-07-18T09:52:29.344+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Upgrade to rails2</title><content type='html'>Yeah, since last week &lt;a href="http://www.palabea.net" target="_new"&gt;palabea&lt;/a&gt; runs on rails2 on production. The actual refactoring was painless and even the production deploy had just minor bugs. There are tiny changes coming with the upgrade - like empty parameters are now blank and not nil - which fell through our test coverage. So a quick look over all your controllers is needed if you want to avoid surprises in production.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-4267601724650778679?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/4267601724650778679/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=4267601724650778679' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/4267601724650778679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/4267601724650778679'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/04/upgrade-to-rails2.html' title='Upgrade to rails2'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-719832114382144533</id><published>2008-04-03T23:21:00.005+02:00</published><updated>2008-07-18T09:52:13.893+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rails'/><title type='text'>Adding parameters to routes</title><content type='html'>Routes are definitly one of the black holes in rails development. Most of the time you are dealing with standard configurations. You have to learn them, but there are not too many options you have.&lt;br /&gt;But last time I wanted something special: to add an parameter to a url if a special route is called. We have /videos and we have /videos?lecture=true. Both are videos, share the same table and model, but they are treated differently in the GUI. So I thought definining a new route /lectures would be nice. I should call the same methods as for /videos but with a special parameter added. There is no way to do it. But hey I thought thats Ruby. What about adding a block, or override a special method. Then I started digging into the code. ... Wow, thats hot stuff, where to start? &lt;a href="http://weblog.jamisbuck.org/2006/10/16/under-the-hood-route-generation-in-rails"&gt;Jamis Buck tried&lt;/a&gt; but I couldn't figure out where and how to place my hook.&lt;br /&gt;Finally I resignated and added a before_filter to the controller which does a regexp check against the request_uri. This does also the job, but I added code to the controller which is part of the routes logic, so really  I dont like the solution. But it works fine for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-719832114382144533?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/719832114382144533/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=719832114382144533' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/719832114382144533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/719832114382144533'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/04/adding-parameters-to-routes.html' title='Adding parameters to routes'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-5464706866536122435</id><published>2008-03-14T23:47:00.003+01:00</published><updated>2008-03-14T23:55:19.882+01:00</updated><title type='text'>External rails plugin resources (and how to get rid of them)</title><content type='html'>Since it seems state of the art to keep plugins as external resources I tried myself to install them via script/plugin -x URL. &lt;div&gt;Maybe I am missing some points here, of course it has some advantages, but in reality this has some big flaws. I would like to keep control over my sourcecode and dont want to deploy on production suddenly realizing there is a new version of a plugin out there. &lt;/div&gt;&lt;div&gt;These external biests are really hard to handle with svn, like merging. Or imagine you need to make changes to these resouces.&lt;br /&gt;Sad but true I found no documentation how to remove these plugins. It cost me some effort to find out since I am no svn guru. But its pretty easy. Just call &lt;/div&gt;&lt;div&gt;&lt;br /&gt;svn propedit svn:externals vendor/plugins. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you get a message that no SVN_EDITOR is defined you have to do that: &lt;/div&gt;&lt;div&gt;&lt;br /&gt;export SVN_EDITOR=mate&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Delete all the external resource entries (file should be blank afterwards) and commit the vendor/plugins directory. Maybe you need a clean checkout before to do this properly.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-5464706866536122435?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/5464706866536122435/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=5464706866536122435' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/5464706866536122435'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/5464706866536122435'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2008/03/external-rails-plugin-resources-and-how.html' title='External rails plugin resources (and how to get rid of them)'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-7868728422432429065</id><published>2007-05-20T22:29:00.000+02:00</published><updated>2007-05-20T22:34:51.061+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac productivity news'/><title type='text'>Smartfolders in Netnewswire</title><content type='html'>I am a long time user of &lt;a href="http://www.newsgator.com/Individuals/NetNewsWire/"&gt;NetNewsWire&lt;/a&gt;, the best newsreader you can find. Its sometimes hard to manage the huge and ever growing mass of blogs, news etc, so I tried a new strategy: I started using smart folders for the mass and try to keep the number of blogs I read regularly low. So I can concentrate on the things I am really interested in.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-7868728422432429065?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/7868728422432429065/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=7868728422432429065' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/7868728422432429065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/7868728422432429065'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2007/05/smartfolders-in-netnewswire.html' title='Smartfolders in Netnewswire'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-1738599430133809937</id><published>2007-05-10T20:14:00.000+02:00</published><updated>2007-05-10T20:43:31.197+02:00</updated><title type='text'>Nice presentation by Hohpe</title><content type='html'>Infoq posted a nice &lt;a href="http://www.infoq.com/presentations/hohpe-soa-development.org/" target="_new"&gt;presentation&lt;/a&gt; by Gregor Hohpe, where he talks about SOA. For him &lt;a href="http://www.martinfowler.com/bliki/DomainSpecificLanguage.html"  target="_new"&gt;domain specific languages&lt;/a&gt; could be an answer to over complicated general languages like BPEL.  &lt;br /&gt;&lt;br /&gt;Also if you havent done so read his &lt;a href="http://www.enterpriseintegrationpatterns.com/ramblings/18_starbucks.htm"  target="_new"&gt;article about starbucks and the two phase commit&lt;/a&gt;: a very nice analogy about asynchronous communication in a real world example.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-1738599430133809937?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/1738599430133809937/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=1738599430133809937' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/1738599430133809937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/1738599430133809937'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2007/05/nice-presentation-by-hohpe.html' title='Nice presentation by Hohpe'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-76420598590715063</id><published>2007-04-03T21:06:00.000+02:00</published><updated>2007-04-03T21:42:35.587+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Spring Rails Burlap Ruby'/><title type='text'>Use Burlap to build a simple Java-Ruby bridge</title><content type='html'>Yes, I know, there is this great tool &lt;a href="http://jruby.codehaus.org/" target="_new"&gt;JRuby&lt;/a&gt; which will hopefully be an essential part of the JDK in the near future, and yes there is REST where &lt;a href="http://www.restlet.org/" target="_new"&gt;Restlet&lt;/a&gt; seems to be the most promising framework, but all I wanted is to speak with a very simple Java Interface from a Rails application. So I thought there must be an easier way, but it has to deal with ongoing changes to the interface. The answer for me was the &lt;a href="http://www.caucho.com/resin-3.0/protocols/burlap-1.0-spec.xtp" target="_new"&gt;Burlap&lt;/a&gt; protocol which you get with Spring for free. All you have to do is to expose your Java bean with the Burlap exporter: &lt;br/&gt;&lt;pre&gt;&lt;br /&gt; &amp;lt;bean id="fooService" &lt;br /&gt;  class="com.agelion.server.impl.DummyService"&amp;gt;&lt;br /&gt;&lt;br /&gt; &amp;lt;bean name="/FooService" &lt;br /&gt;   class="org.springframework.remoting.caucho.BurlapServiceExporter"&amp;gt;&lt;br /&gt;     &amp;lt;property name="service" ref="fooService"/&amp;gt;&lt;br /&gt;     &amp;lt;property name="serviceInterface" &lt;br /&gt;        value="com.agelion.server.FooBackendService"/&amp;gt;&lt;br /&gt; &amp;lt;/bean&amp;gt;&lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;. Thats it for the Java side. Burlap is a very simple protocol where you dont map classes, what you get is a map with key, value pairs. But thats fine for me. &lt;br /&gt;&lt;br /&gt;But also the Ruby side is easy to implement. I am still a newby with Ruby but that was relativly quick done (though its still not as easy to get information like you get for J2EE for instance, where you get too much information).&lt;br /&gt;Because the Burlap protocol just supports the POST method you need the low level Ruby methods for Http: &lt;br/&gt;&lt;pre&gt;&lt;br /&gt;Net::HTTP.start('localhost', 8080) do |request| &lt;br /&gt;    response = request.post('/backendservice/FooService', &lt;br /&gt;     '&amp;lt;burlap:call&amp;gt;&amp;lt;method&amp;gt;myMethod&amp;lt;/method&amp;gt;&amp;lt;/burlap:call&amp;gt;')&lt;br /&gt; &lt;/pre&gt; &lt;br /&gt;And here we go. All you have to do is to parse this XML: &lt;br /&gt;&lt;br/&gt;&lt;pre&gt;&lt;br /&gt; vals = []&lt;br /&gt; XPath.each( Document.new(response.body),&lt;br /&gt;     "//burlap:reply/list/map/*") &lt;br /&gt; {|p|  vals &lt;&lt; p.text }&lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;And as I said, what you get are key-value pairs with the exception of the first element which descripes the original type (classname). &lt;br /&gt;I converted it to a map skipping the first element in the array: &lt;br /&gt;&lt;br/&gt;&lt;pre&gt;&lt;br /&gt; @bashvals = {}&lt;br /&gt; 1.step(vals.length-1, 2) &lt;br /&gt;    { |i|  @bashvals[vals[i]] = vals[i+1] }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-76420598590715063?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/76420598590715063/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=76420598590715063' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/76420598590715063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/76420598590715063'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2007/04/use-burlap-to-build-simple-java-ruby.html' title='Use Burlap to build a simple Java-Ruby bridge'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-222546256315094538</id><published>2007-03-07T21:47:00.001+01:00</published><updated>2007-03-07T21:47:34.419+01:00</updated><title type='text'>Writing tests that test failure</title><content type='html'>Often forgotten because most of the time you want to proove that your code runs. Yes I know we all tend to be lazy. But to be complete in a sense of Sir Carl Popper you also have to falsify your assumption. You are forced to think about deeper about what your code does and what it should not do. But even further you proove that exceptions are treated correct in case of an error or worse like it happened to me it gets swallowed. I was about to refactor an ancient piece of software written in the early days of Java development. I wrote a test for a new feature and was happy to see my test was successfull. But writing a failure test I recognized that every exception was swallowed by an nice try {} catch (Exception) block just because this test failed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-222546256315094538?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/222546256315094538/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=222546256315094538' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/222546256315094538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/222546256315094538'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2007/03/writing-tests-that-test-failure.html' title='Writing tests that test failure'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-116349036524811032</id><published>2006-11-14T08:43:00.000+01:00</published><updated>2006-11-14T08:46:05.260+01:00</updated><title type='text'>Testing with maven2</title><content type='html'>While I like &lt;a href="http://maven.apache.org/"&gt;maven2&lt;/a&gt; because of its productivity benefits now a simple task was taking me some time of research. I have to deal with some legacy code where some tests exists, but these are plain java code with main methods. I look forward to refactor them to junit tests, but step by step. So I have to tell maven what class to use and what not. For two reasons I'd  like to gather them all in a testsuite. First I could start the suite easily from my IDE, and second I have another testsuite, which will require an external Corbaserver running. So I would like to seperate these tests. &lt;br /&gt;&lt;br /&gt;There are two points to consider: &lt;br /&gt;&lt;br /&gt;1) Because maven doesnt seem to work with suites you have to write a TestCase like this: &lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;public class SuiteTest extends TestCase {&lt;br /&gt;&lt;br /&gt;    TestResult tr = null;&lt;br /&gt;&lt;br /&gt;    public void testSuite() {&lt;br /&gt;        TestSuite suite = (TestSuite) YourTestSuite.suite(); &lt;br /&gt;        suite.run(tr);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public void run(TestResult res) {&lt;br /&gt;        tr = res;&lt;br /&gt;        testSuite();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;2) Whereas in &lt;a href="http://maven.apache.org/maven-1.x/"&gt;maven1&lt;/a&gt; it was simple to configure the unit tests with the &amp;lt;unittest&amp;gt; tag, this doesnt work in maven2 anymore. In the pom.xml you have to &lt;a href="http://maven.apache.org/plugins/maven-surefire-plugin/examples/inclusion-exclusion.html" &gt;configure the surefire plugin&lt;/a&gt; which runs the test. Thats not obvious for a maven1 user, so its not easy to find the right documentation. But the maven2 concept is to be more plugable. So its easier to include &lt;a href="http://testng.org/"&gt;Testng&lt;/a&gt; for instance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-116349036524811032?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/116349036524811032/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=116349036524811032' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/116349036524811032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/116349036524811032'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2006/11/testing-with-maven2.html' title='Testing with maven2'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-116214013501191083</id><published>2006-10-29T17:41:00.000+01:00</published><updated>2006-10-29T17:44:09.606+01:00</updated><title type='text'>Amateur projects</title><content type='html'>It happend to me again. Today I found myself in a new project where everything seems to go wrong. The climate is non productive, they have sitting 12 developers, where I guess 2 or 3 good ones can do the same job. They have absolutly no unit tests, no build server, no documatation, neither external nor within code, no code reviews, a lot of changing developers, an over complicated build system which doesnt work, too much code which is solved by open source libraries, and so on. If you work like this you get used to it, but if you know there is a much different way there is only one way: you have to tell. The decision is as always between leave this as soon as possible or try to change, which of course is much harder. But this depends on the situation, as long as there is enough money nobody cares. Its easier to convice them if they realize its a case of surving.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-116214013501191083?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/116214013501191083/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=116214013501191083' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/116214013501191083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/116214013501191083'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2006/10/amateur-projects.html' title='Amateur projects'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-115297926525900956</id><published>2006-07-15T18:00:00.000+02:00</published><updated>2006-07-15T18:23:36.306+02:00</updated><title type='text'>Checkout Maven</title><content type='html'>I worked for a company where they used &lt;a href="http://maven.apache.org"&gt;Maven&lt;/a&gt; as a standard build tool. They used maven1, but I had some spare time the last couple of weeks, so I used it to play with maven2. I read the book &lt;a href="http://www.amazon.com/gp/product/0596007507/sr=8-2/qid=1152973840/ref=pd_bbs_2/103-2950807-2805431?ie=UTF8"&gt;Maven&lt;/a&gt; from the Developers Notebook series and &lt;a href="http://www.mergere.com/m2book_download.jsp"&gt;Better Build with Maven&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;First of all, why use Maven instead of Ant, which are most familiar with? &lt;br /&gt;&lt;br /&gt;1) Its a collection of best practices of build &amp; configuration managment: Where do I put my configuration files, how do I integrate common tools like xdoclet, clover or checkstyle, make project reports, where do I put my external jars, how to announce a new version, do the deployment and so on. When I checkout old projects of mine, which are based on Ant, I always have to look in the build.xml  how and where files are copied and so on. With maven thats not the case, because everything is just at the right place. And because with Ant there is no standard build structure, every project is different.&lt;br /&gt;&lt;br /&gt;2) Reuse: Maven has a plugin concept. Every task is a plugin which gets loaded when you use it the first time, or gets updated if there is a new version. Even common tasks like clean are plugins. So you dont need to write scripts, you just call &lt;i&gt;mvn clean&lt;/i&gt; without having any definition of clean in your project file. &lt;br /&gt;&lt;br /&gt;3) Productivity: you start creating a new project with &lt;i&gt;mvn archetype:create -DgroupId=your.main.package -DartifactId=projectname&lt;/i&gt; and you get a basic project structure. You define your final archive like jar, war or ear, add your external jar dependencies to pom.xml, call &lt;i&gt;mvn eclipse:eclipse&lt;/i&gt; or &lt;i&gt;mvn idea:idea&lt;/i&gt;, you get your project files for your IDE and can start working within seconds. And finally &lt;i&gt;mvn install&lt;/i&gt; compiles your code, runs your unit tests and packages your archive. All that is done without the need to write any build code. Last but not least maven2 is faster than Ant. &lt;br /&gt;&lt;br /&gt;There is much more you get with maven for free, like cruisecontrol integration, repository integration plus reports and stats, you can run your httpunit or cactus tests out-of-the-box. &lt;br /&gt;&lt;br /&gt;The dependency managment is great: Maven supports transitive dependencies, so if you use &lt;a href="http://struts.apache.org/"&gt;Struts&lt;/a&gt; you just add Struts to your dependencies and get all jars needed by Struts. Maven provides automatic conflict managment. And every dependency has a scope, some jars are just needed at compile time, for tests and so on. All that is nothing you have to worry about, you just add the scope tag to your dependency. &lt;br /&gt;&lt;br /&gt;So I really believe every java developer should consider using Maven, at least give it a try and play around with it a little bit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-115297926525900956?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/115297926525900956/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=115297926525900956' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/115297926525900956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/115297926525900956'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2006/07/checkout-maven.html' title='Checkout Maven'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-115107936969603723</id><published>2006-06-23T18:15:00.000+02:00</published><updated>2006-06-23T18:18:02.120+02:00</updated><title type='text'>Fun with testing</title><content type='html'>I will not talk about the need for unit tests. This I would say is common sense for a modern thinking developer. I recently had to do some small changes in a project. The main developer had already left the company and I got a brief introduction. They all felt very secure because there was a testcase for every single usecase, and also for every possible error. But these were integrationtests, they wrote something into a database, sent requests per URL and parsed the result with httpunit.&lt;br /&gt;So far so good, everyone was happy, but me. Why that? Of course because there were no unit tests at all. It took me about three days to get the tests running. They used real services instead of mocks, so the tests ran just on a dedicated machine, because of firewall restrictions. The logs where analysed to ensure proper behaviour, but because they where running on an external machine, there where some shell scripts to pipe the logs to a socket. I played around for a while, even tried to use logj4 SocketAppender but failed to get the whole thing running. God knows why. So I dropped that validation. The script to run the tests swallowed every exception. The tests were running about 30 minutes, so after reading the latest news you just saw that some of the tests failed but had no glue why. &lt;br /&gt;&lt;br /&gt;That all pissed me of, so I started writing unit tests and mock objects. One of my first tests failed and I was wondering why. I discovered a bug where two flags from an external database had been read in the wrong order. You have to know these where not just two flags nobody cared. These had been two of five values these app was evaluating, one of the reasons why these service was written. To evaluate these and to redirect the user depending on the combination of these. &lt;br /&gt;&lt;br /&gt;WTF?! But what about the integration tests? At least they ran without an error. So after looking at the testcode, I couldnt believe my eyes: the good old boy was reversing his error and exchanged the flags at initialization time, so everything was looking fine again. I can imagine the situation, maybe he was wondering why his tests failed and thought, oh i might have exchanged the flags. So after reversing them he got the green bar. &lt;br /&gt;&lt;br /&gt;This app was in production state for about one year and everyone was happy, but me .....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-115107936969603723?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/115107936969603723/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=115107936969603723' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/115107936969603723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/115107936969603723'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2006/06/fun-with-testing.html' title='Fun with testing'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-30004545.post-115083059987787557</id><published>2006-06-20T21:09:00.000+02:00</published><updated>2006-06-20T21:09:59.893+02:00</updated><title type='text'>SpringOne in Antwerp</title><content type='html'>It was my first conference since a long time and it was a real pleasure to be there. I do Spring development for over half a year right now and I was excited to see whats currently going on. There were about 410 attendees, and we could listen to 40 presentations. But we had to choose beween four parallel talks, which was a hard decision sometimes. The slides will be published on the SpringOne site at the end of June and the DVD will be available in September. &lt;br /&gt;&lt;br /&gt;The biggest news was Spring 2.0 is ready to use, the final is scheduled for July. Its fully compatible with Spring 1, so no changes for existing apps. Which is great I think, and shows the big advantage of working with POJOs and AOP with loose coupling in mind. You dont destroy old code if you add more. Most of the talks had a relation to the new features included in this new version. For a complete overview &lt;a href="http://static.springframework.org/spring/docs/2.0.x/reference/new-in-2.html" target="_new"&gt;click here&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;At the keynote Rod Johnson told how many professionals are using Spring, even in mission critical projects like in the banking sector. There were some case studies given, and the message was clear: Spring is not just production ready, every JEE project should switch. Spring is more, its an philosophy, a commitment to agile development, to simplicity, and more or less to test driven development, because its one of Springs key points, to hold your code testable. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;It was obvious that this conference was sponsored by at least two majors namely Oracle and BEA, they even had two talks together. Both are very into JPA, which is supported by Spring since 2.0. I for myself found it funny that Hibernate was mentioned very seldom at this conference ;-) JPA should be the new one and only persistence API in the future, say goodby to JDO. The Hibernate -API will be maintained in the future, but will not developed any further. But Hibernate is on their way to support the new &lt;a href="http://www.jcp.org/en/jsr/detail?id=220" target="_new"&gt;JSR-220&lt;/a&gt;, so this should be no principal problem for Hibernate users, like myself. It was news for me that &lt;a href="http://www.bea.com/framework.jsp?CNT=index.htm&amp;FP=/content/products/weblogic/kodo/" target="_new"&gt;Kodo&lt;/a&gt; is bought by BEA and Opensource as well as the core engine of TopLink, &lt;a href="http://www.oracle.com/technology/products/ias/toplink/jpa/index.html" target="_new"&gt;TopLink Essentials&lt;/a&gt;. The latter is the reference implementation for the new Java persistence API. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;Both companys are very commited to Spring, they will support Springs way to a defacto standard for middleware apps. So &lt;a href="http://www.interface21.com/pitchfork" target="_new"&gt;Pitchfork&lt;/a&gt; is a co-production from BEA and Interface21, an add-on for the Spring Framework for Java EE 5. Spring should provide a foundation for serveral Java Enterprise Edition 5 key components, like EJB 3 interception. But it has more features (e.g. typesafety and pointcuts for interceptors) and is more flexible.&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Which leads me to another main feature of Spring 2.0, better AspectJ integration and support. The merge of AspectJ and AspectWerks was a big step forward standardizing AOP, so its great that Spring is not further going their own way. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;A not so spectacular but I think very usefull new feature is custom namespaces in Spring configurations. My last several projects were a typical SOA landscape with many small services. We had some naming conflicts in our configurations, and custom namespace is an solution. On the other hand your configuration gets more readable and less error prone if you define your own types. There are small restrictions though like just singletons are supported (which will change asap). &lt;br /&gt;&lt;p&gt;&lt;br /&gt;The &lt;a href="http://getahead.ltd.uk/dwr" target="_new"&gt;DWR Framework&lt;/a&gt;, an Ajax protocol layer for Java, which was &lt;a  href="http://bram.jteam.nl/wp-content/uploads/2006/06/dwr_and_spring.pdf"  target="_new"&gt;presented&lt;/a&gt; at the very beginning, is one of the early implementers of this feature. It really does make sense to have more context aware tag- and attributenames. And with schemas you can define possible enumeration-values for instance. So your IDE shows immediatly the read line for wrong values. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;Juergen Hoeller presented the JMS support by Spring, of course including the new features like asynchronous JMS and the task executers, which can work like message driven beans in non managed environments. I dont want to go too much into detail here, but he brought some gotchas and best practices with sending JMS. The new thing is the ability to receive messages in a typical spring way. He used a SessionAwareMessageListener to send a reply message, which is a Spring style MDB. It can participate in transactions and so one. The only thing missing here is a connection pool, this you get from your JMS provider. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;The last talk I listened to was about the new &lt;a href="http://www.springframework.org/spring-ws" target="_new"&gt;Spring-WS&lt;/a&gt; framework, an Spring add-on. First off all, why another Webservice framework? Its key points are of course  ease-of-use and excellent Spring integration, but it focuses on document driven Webservices and contract first WSDL development. Thats a difference to XFire for instance. So you work more with XML, but its the payload XML without the SOAP stuff. To the contrary, with XFire you expose your objects. You get Marshallers and Unmarshallers of course, to parse the XML. But XML is the first thing you have got in your hand with Spring-WS. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;As I said many talks were in parallel so I missed some of them, like the clustering solution from terracota, some in depth talks about JPA, domain driven development and so on. &lt;br /&gt;&lt;p&gt;&lt;br /&gt;Despite the landing of the new version, there are many ideas where to go in the future. Simplier configuration and better production support, like profiling and tuning and more use of JMX are some ideas. But it also depends on the community. Everyone who is interested in or even working with Spring, should regularly check and better post to the &lt;a href="http://forum.springframework.org/"  target="_new"&gt;forums&lt;/a&gt;. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/30004545-115083059987787557?l=woeginger.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://woeginger.blogspot.com/feeds/115083059987787557/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=30004545&amp;postID=115083059987787557' title='0 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/115083059987787557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/30004545/posts/default/115083059987787557'/><link rel='alternate' type='text/html' href='http://woeginger.blogspot.com/2006/06/springone-in-antwerp.html' title='SpringOne in Antwerp'/><author><name>Martin Wöginger</name><uri>http://www.blogger.com/profile/12232663746624991471</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='22' src='http://www.exasoft.net/mw/pics/mw2001.jpg'/></author><thr:total>0</thr:total></entry></feed>
