The Holy Java

Building the right thing, building it right, fast

Archive for May, 2011

Most interesting links of May

Posted by Jakub Holý on May 31, 2011

Recommanded Readings

Acceptance testing / Specification by example:

  • Gojko Adzic: Anatomy of a good acceptance test – an example of refactoring a bad acceptance test into a good one – good for learning about pitfalls and how a good one should look like
  • Gojko: Top 10 reasons why teams fail with Acceptance Testing – acceptance testing is great and brings lot of value but must not be underestimated; some of the problems are bad collaboration, focusing on “how” instead of “what,” confusing AT with full regression tests. Brief, worth reading.
  • Specification by Example: a love story (go directly to the PDF with the story): A nice, made-up story of going from low-level, workflow-based Selenium tests through similar Cucumber ones to true BDD tests describidng clearly what, not how – very well shows the point of specification by example and how it should (and should not) look like

(Enterprise) Java best practices:

  •  Clean code, clean logs: 10 brief posts on logging best-practices – nothing really new here for me but in total it is a very good overview that every developer should know
  • Make Large Scale Changes Incrementally with Branch By Abstraction – Continuous integration doesn’t work well with branches but as this article shows, you can manage even large-scale refactorings without branches using “branch by abstraction,” an approach reminding me of Fowler’s “strangler application” (an incremental replacement of a legacy system). The idea is: 1. Create an abstraction over the part of code to be changed;  2. Refactor the code to use it; 3. Implement new functionality using the new way / step by step move old functionality too, the abstraction layer delegating either to the new or old implementation … . It may be more work but: 1) your software is always working and deliverable; 2) (side-effect) in the end it will be more decoupled


  • John Wiegley’s Git from the bottom upp (31p, Git, PDF) – a useful explanation of the fundamentals of Git, i.e. how it is constructed and how it works, which makes it much easier to understand how to  use it properly (recommended by Pål R.). Reading the The Git Parable first may be a good idea for an easy introduction into the fundamentals, though absolutely not necessary. This document introduces very well the important Git concepts (blob, index, commit, commit names such as branches, reflog) and how they cooperate to provide the rich set of functionality it has. It also explains well the value and usage of rebase. Among others I’ve appreciated the tip to use checkout, branch -m <new-branch> master, branch -D instead of the much more dangerous reset –hard and the tip to use stash / stash apply to create daily backups of your working tree in the reflog (with clearing it with ‘git reflog expire –expire=30.days refs/stash‘ instead of stash clear). Also git diff/log master..[HEAD] for reviewing work done in the current branch and and git diff/log ..master for checking the changes since the last merge/rebase after a fetch are interesting.


  • The secret power of bookmarklets – bookmarklets are an indispensable tool for every developer who works with web applications (to fill in test data, speed up log in, …), yet I’m sometimes surprised by meeting people who don’t know or use them; this blog explains them nicely, links to some useful ones and some useful tools for building them

Recommended Books

  • (*****) Implementing Lean Software Development: From Concept to Cash by Mary Poppendieck, Tom Poppendieck – A great introduction into lean thinking (the values and principles it is build upon), clearly communicated with the help of “war stories”. I absolutely recommend it to anybody interested in lean/agile.
  • (**** ) Agile Project Management with Scrum (Microsoft Professional) by Ken Schwaber – Even though you can’t understand Scrum without experiencing it, this book full of war stories will help you to avoid many Scrum implementation pitfalls and to understand its mantra of “the art of the possible” and will show you how to adapt Scrum to various situations. It’s very easy to read thanks to its format of brief case studies organized by topics (team, product owner, …).

Favourite Quotes of the Month

@unclebobmartin: Cleaning code does NOT take time. NOT cleaning code does take time.


Posted in General, Languages, Testing, Tools, Top links of month | Tagged: , , , , , , , , , , | Comments Off on Most interesting links of May

Ivy: How to Retrieve Source Codes of Dependencies

Posted by Jakub Holý on May 20, 2011

Summary: To download sources you must map the dependency’s conf also to ‘sources’ (ex.: conf="myScope->default,sources").

If you are using Apache Ivy (2.2) for maintaining you dependencies, you may also want to retrieve source codes (or javadocs) of those dependencies, e.g. to get nice help pop-ups in Eclipse or to actually browse the sources. Provided that you’re retrieving the dependencies from Maven repositories, the configuration required to enable retrieval of source codes is to map to the Ivy “configuration” (“scope”, or perhaps more exactly classifier, in the Maven language) called “sources” (or “javadoc” to fetch JavaDocs).

Read the rest of this entry »

Posted in Tools | Tagged: | Comments Off on Ivy: How to Retrieve Source Codes of Dependencies

Installing Java 1.4 to Mac OS X 10.6

Posted by Jakub Holý on May 11, 2011

Sometimes you really need java 1.4, mainly because just compiling with -target doesn’t protect you from inadverently using an API that only exists in 1.5+.

Fortunately, Jens v. P. has described how to install Java 1.4 on Mac OS X without destroying your current (latest) java installation – download Java_for_Mac_OS_X_10_5_Update_4 from Apple and use Pacifist to install only System/Library/Frameworks/JavaVM.framework/Versions/1.4.2 and 1.4. Thanks, Jens!

Posted in General, Languages | Tagged: , | Comments Off on Installing Java 1.4 to Mac OS X 10.6

Discussion: Agile not suitable for governmental IT?

Posted by Jakub Holý on May 6, 2011

The recent article Agile will fail GovIT, says corporate lawyer is rather controversial but very valuable. Its value lays not in its claim that agile cannot work in governmental environment, something I quite disagree with, but in its presentation of how (inaccurately) agile is/may be perceived in this environment and of obstacles posed by such an environment to any (and especially to agile) development.

The article reveals a fundamentaly psychological and social issue. It doesn’t question the ability of agile to deliver projects much more successfully than waterfall. The laywer, Alistair Maughan, doesn’t speak at all about projects’ results. He speaks about fear (to bear the consequences of a failure) and constraints present in governmental environment. Thus it’s pointless to argue about benefits of the agile and absurdity of the waterfall approaches. The key to a successful project is to understand those constraints, lift them as much as possible, and create a security structure for both governmental officials and the supplier to be able to work within those constraints safely. We shouldn’t forget that there are also smart people in the government agencies who will gladly accept a methodology that leads to better results as long as they are safe from being denounced on the front side of newspapers as bad public servants when something goes wrong.

Read the rest of this entry »

Posted in General | Tagged: , , | 2 Comments »

Upgrading FCKeditor 2.x to CKEditor 3.x including plugins

Posted by Jakub Holý on May 6, 2011

Upgrading FCKEditor 2.x with custom plugins to CKEditor 3.x is a challenging task because so much has changed but it is possible. I’d like to share here few experiences from the upgrade and show how to map the most important API use cases from the old to the new version and ease the migration by first introducing a facade for (F)CKEditor APIs.
Read the rest of this entry »

Posted in General | Tagged: | 2 Comments »