Home » Author Archives: Tomasz Nurkiewicz (page 6)

Author Archives: Tomasz Nurkiewicz

Java EE developer, Scala enthusiast. Enjoying data analysis and visualization. Strongly believes in the power of testing and automation.

Synchronising Multithreaded Integration Tests revisited

java-interview-questions-answers

I recently stumbled upon an articleSynchronising Multithreaded Integration Tests on Captain Debug’s Blog. That post emphasizes the problem of designing integration tests involving class under test running business logic asynchronously. This contrived example was given (I stripped some comments):               public class ThreadWrapper { public void doWork() { Thread thread = new Thread() { ...

Read More »

Lazy sequences in Scala and Clojure

scala-logo

Lazy sequences (also known as streams) are an interesting functional data structure which you might have never heard of. Basically lazy sequence is a list that is not fully known/computed until you actually use it. Imagine a list that is very expensive to create and you don’t want to compute too much – but still allow clients to consume as ...

Read More »

SiftingAppender: logging different threads to different log files

logback-logo

One novel feature of Logback is SiftingAppender (JavaDoc). In short it’s a proxy appender that creates one child appender per each unique value of a given runtime property. Typically this property is taken from MDC. Here is an example based on the official documentation linked above:               <?xml version="1.0" encoding="UTF-8"?> <configuration> <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender"> ...

Read More »

WatchService combined with Akka actors

akka-logo

WatchService is a handy class that can notify you about any file system changes (create/update/delete of file) in a given set of directories. It is described nicely in the official documentation so I won’t write another introduction tutorial. Instead we will try to combine it with Akka to provide fully asynchronous, non-blocking file system changes notification mechanism. And we will ...

Read More »

Synchronizing transactions with asynchronous events in Spring

spring-interview-questions-answers

Today as an example we will take a very simple scenario: placing an order stores it and sends an e-mail about that order:                   @Service class OrderService @Autowired() (orderDao: OrderDao, mailNotifier: OrderMailNotifier) { @Transactional def placeOrder(order: Order) { orderDao save order mailNotifier sendMail order } } So far so good, but e-mail ...

Read More »

FitNesse your ScalaTest with custom Scala DSL

scalatest-logo

This article won’t be about FitNesse. As matter of fact I don’t like this tool very much and it seems to be loosing momentum, judging by the traffic on an official mailing list. Instead we will implement trivial internal DSL on top of Scala to simplify testing code, inspired by DoFixture. DoFixture in FitNesse allows one to write very readable ...

Read More »

Promises and futures in Clojure

clojure-logo

Clojure, being designed for concurrency is a natural fit for our Back to the Future series. Moreover futures are supported out-of-the-box in Clojure. Last but not least, Clojure is the first language/library that draws a clear distinction between futures and promises. They are so similar that most platforms either support only futures or combine them. Clojure is very explicit here, ...

Read More »

Promises and Deferred objects in jQuery and AngularJS

software-development-2-logo

Series of articles about futures/promises without JavaScript would not be complete. Futures (more commonly named promises in JS land) are ubiquitous in JavaScript to the point where we almost don’t recognize them any more. AJAX, timeouts and whole Node.JS are built on top of asynchronous callbacks. Nested callbacks (as we will see in just a second) are so hard to ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close