Akka: To ask, or not to ask?

There are times that Akka Actors need to contact some other Actor, get the response and then continue their processing. It is debatable whether this is a good design or not. However, when designing Akka APIs to be used by different libraries/modules, it is a reality that someone may have to deal with - especially when many different teams collaborate with each other, so you don’t have access to others' code. [Read More]
scala  akka  ask  tell 

Scala: Use fold to serialize any number of Futures

Scala’s for-comprehensions are extremely useful and offer much more than just looping. For this post, I would like to focus on using for-comprehensions for manipulating Futures. More specifically, for serializing Futures. Let’s assume that we have a function that performs some kind of logic and returns a Future: def addOneAndPrint(num: Int): Future[Unit] = { Future { val addedOne = num + 1 print(addedOne + " ") } } Users of such a fuction, may want to call it more than one time and additionally, to call it serially. [Read More]
scala  for  fold 

A (kind-of) Dependency Injection in Scala

The problem While projects evolve, the lines of code increase and the dependencies between the classes are becoming more and more complicated. With the absence of some Dependency Injection (DI) framework/library, this ends up quickly in having to pass instances here and there through constructors of classes. The constructors may end up having something like 10+ arguments. To make things worse, for some cases, these arguments are not used by the logic of the classes themselves, but instead, they are just used to create subclasses! [Read More]

OSGi: Finding the way to JEE and JSF

Note: You may find the complete source code for this tutorial here. Combining the modularity offered by OSGi with the EE technologies may result to powerful, scalable and maintainable applications. Eclipse Virgo bridges OSGi and JEE worlds and provides a “completely module-based Java application server”. Even if the Virgo documentation provides detailed explanations, it seemed difficult to find tutorials that are functional and build up to a JEE Web application that is powered by OSGi bundles and services. [Read More]