Browsed by
Category: Java

Favoured podcasts

Favoured podcasts

I migrated my desktop PC to Windows 7 Professional. I didn’t choose the upgrade path, I install Windows 7 from scratch. So, after installing iTunes I had to register my favoured podcasts again: .Net .Net Rocks! Hanselminutes herding {code} Stackoverflow Polymorphic Podcast Alt.NET podcast Java The Java Posse Software engineering radio Currently I work in a .Net environment, so the list of .Net podcasts is a bit longer. If you are interested in more Java podcasts, there is a question…

Read More Read More

How to structure code in an unit test

How to structure code in an unit test

When you create your unit tests for a method in the SUT (software under test) you will ask yourself how to structure the code in the test method.I saw two kind of syntaxes which help to structure the code in a unit test method (well, actually there are at least three, but the third syntax is just chaos, so this is definitely not the way how to do it). SEVT-Syntax [code language=”csharp”] [TestFixture] public class ThingTest { [Test] public void…

Read More Read More

First groovy experiences

First groovy experiences

Currently I’m staying at copenhagen at the GR8Conf (Grooy, Grails and Griffon confernence). In the talk of the day by Guillaume Laforge about DSLs he showed the following code: [sourcecode language=”groovy”] class CurrencyAmount { Number amount String currency String toString() { "$amount $currency" } } Number.metaClass.getEuros {-> new CurrencyAmount(amount:delegate, currency:"EUR")} 10.euros //Output: 10 EUR [/sourcecode] It is really interesting to see where in the java world the language evolvement happend. It’s a bit similiar (I’m careful here, because I do…

Read More Read More

Fall-thru or not to fall through

Fall-thru or not to fall through

There is a little differences how C# and Java implement the switch-statement. I discovered it when I want to implement a fall through in C#. In Java it is very simple: just leave the break statement at the end of the case block away. In C# it doesn’t work like that. There is no implicit fall through (with one exception: The case blocks have to be empty). You have to implement it explicit by add at the end of the…

Read More Read More