Jul 042013
 

Wizard dialogs are a very common design pattern for user interfaces,
e.g. for the GUI of software installation tools.
However, although wizard dialogs are so ubiquitious these days, component
frameworks such as Swing or JSF do not provide any support for them, so you
have to turn to a third party library or roll your own.
In this blog posting, I am modeling an abstraction for internationalized
wizard dialogs which is independent of the particular user interface technology
and easy to implement and use, e.g. in Swing based desktop applications or JSF
based server applications. Continue reading »

Jun 062013
 

I just came along a very interesting blog posting about Domain Specific Languages (DSL) in Java. In his posting, Mohamed Sanaulla nicely discusses three different patterns to define an internal DSL for constructing object graphs: Method Chaining, Nested Functions and Lambda Expressions. In this series, I am going to look into each of them. In this first posting of the series, I am going to look into the Method Chaining pattern. Continue reading »

Feb 132013
 

Pretty much any program needs to do I/O to process some data. Sure, in Java we have InputStream and OutputStream (or its modern day cousin, Channel) to do this with relative ease. However, this is not the end of the story. In everyday programming, I often need some higher level abstractions. Actually, I need them so often that I wonder why there are no abstractions like the following in the JSE API. Continue reading »

Aug 172012
 

There are many ways to update a value atomically, so without introducing racing conditions in multithreaded environments. A well-performing way of doing this in Java is to use an AtomicReference or one of its companion classes in the package java.util.concurrent.atomic. However, using an AtomicReference is quite cumbersome. But with Scala, you can easily factor out the cumbersome usage pattern like follows. Continue reading »

 Comments Off on Generic CAS (compare-and-set) for Scala  Tagged with: ,