• Home
  • RSS Feed
  • Log in

Author Archive

Scala actors for the enterprise: introducing the Akka framework
Posted by Arjan Blokzijl just before lunchtime: October 22nd, 2009

Last week me and some of my colleagues had the pleasure of being on the receiving end of an excellent training given by Jonas Bonér. The topic was his new pet project: the Akka framework. Perhaps you've played around with Scala lately, and also have taken the first steps in using its Actor library. Simply stated, an Actor is a unit of execution that (usually asynchronously) processes messages and encapsulate their state. An actor does not expose its state, and messages are processed sequentially. The Actor model has been around for quite some time, but today the best-known Actor implementation is Erlang.
The Actor model has been implemented in the standard Scala library by Philipp Haller (for the interested reader, a solid reference is for instance this article explaining how actors in Scala work). In most Actor examples written in Scala, it is not uncommon to find only EchoActors, PingPongActors, and FibonacciSolvingActors. Nice examples, but perhaps you might wonder if they are of any use in enterprise Scala at all. Next to this, if you're interested in concurrent, message passing processing models, STM's, NoSQL data stores, and occasionally wonder what the future in enterprise computing might bring, than Akka might be just the framework you're looking for. This blog is intended to provide a brief introduction into one feature of this framework: Akka's supervisor Actors. It is mostly based on the knowledge extracted from Jonas during the training, and I hope to whet your appetite for it.

(more...)

  • Share/Bookmark

Tags: akka, Scala
Filed under Akka, Scala | 10 Comments »

Functional bowling in Scala
Posted by Arjan Blokzijl just before lunchtime: July 25th, 2009

I have read about implementing the bowling game XP-style many years ago in Robert Martin's book 'Agile Software Development'. The episode can be found online as well.
Recently he has recently been learning Clojure and attempted to implement the bowling game in Clojure.
It is a nice exercise, and although I like Clojure, I do not regard myself capable in any way to repeat such an attempt. Apart from that Stuart Halloway, author of the excellent 'Programming in Clojure' book, has already done this in a much better way than I ever could. I'm slightly more familiar with Scala, so I thought it would be a nice exercise to try some functional bowling using that. My Scala knowledge is in a deplorable state, stuck at pre-beginner level, so I run the risk of making a complete fool of myself. However I'll take the chance and at least try to learn from the experience.

(more...)

  • Share/Bookmark

Tags: Functional Programming, Scala
Filed under Functional Programming, Scala | 7 Comments »

Scala REPL tips and tricks (trunk only)
Posted by Arjan Blokzijl in the early afternoon: July 19th, 2009

The path on the road to learning Scala usually involves using the REPL. this is a very handy way of trying out functions you write easily and quickly, without having to set up an entire IDE environment. Scala's latests stable release Scala 2.7.5. Scala 2.8 will be out in a couple of months, as things stand now. This new release will contain a number of enhancements and new features, and if you can't wait to try this out, you should check out and use the trunk. I've previously blogged about starting with Scala, and also hinted at trying this out. In this blog, I'll show some more concrete examples of the and a few neat things that you can do if you're willing to take this step.
(more...)

  • Share/Bookmark

Tags: Scala
Filed under Scala | 1 Comment »

Real world functional programming in Scala – comparing Java, Clojure and Scala
Posted by Arjan Blokzijl mid-afternoon: July 4th, 2009

I recently started reading Stuart Halloway's book 'Programming in Clojure'. I don't think I will be writing much enterprise applications in that language in the near future, but it never hurts to broaden the mind, and it's a very good read. In his book, he demonstrates some of the advantages of functional programming by taking an example from the Apache commons library: StringUtils.indexOfAny. He has also written a blog about it.
In this blog post, we'll compare the original function in Java, the Clojure version and a Scala implementation.
(more...)

  • Share/Bookmark

Tags: funtional programming, Scala
Filed under Functional Programming, Scala | 15 Comments »

Starting out with Scala
Posted by Arjan Blokzijl around lunchtime: July 3rd, 2009

Scala has become more and more popular over the recent months/years. Its hybrid nature of being an imperative as well as functional language attracts a crowd from the Java world as well as functional fundamentalists coming from the world where statements like x=x+1 are looked at with the utter disbelief. It has been stated that Scala is 'Java as it should have been', but there are also numerous complaints about the language and its features (like not being side effect free, overly complex, too much of everything, too much abstraction, having a weird syntax, etc). The latter might actually be a proof of its popularity, since people seem to be actually using the language instead of just looking at it briefly and stopping, tired but happy, after having written hello world with it.
In this blog post, I'll give you some (hopefully) useful tips how to best start if you want to learn this language, which is one of the candidates become 'our next big language' and surpass Java in this respect.
(more...)

  • Share/Bookmark

Tags: Scala
Filed under Scala | 9 Comments »

Accessing generic types at runtime in Java
Posted by Arjan Blokzijl mid-morning: February 7th, 2009

I was writing my n-th Dao implementation, this time using JPA.
I (and probably a whole lot of others) usually create a DAO per entity, parameterizing the entity type.
Specific DAO instances for entities implement the generic DAO using their entity type as type parameter. One generic DAO implementation exists, containing common operations like findById, persist, remove, etc. This generic DAO uses the class type specified by the implementing DAO classes (e.g. a Person) to manipulate or query the entity specified by this type. The (slightly) annoying problem for me has always been to instantiate that entity type in the generic DAO superclass. I've always done this by just creating a constructor in the generic DAO which takes a class argument containing the required Class of the entity. However, there's a better way, which I'll show in this post.
(more...)

  • Share/Bookmark

Tags: generics, Java, JPA
Filed under JPA, Java | 10 Comments »

QCON SF: return of the fundamentalist functional programmer
Posted by Arjan Blokzijl in the early afternoon: November 30th, 2008

While attending QCon San Francisco, I had the particular pleasure of attending a whole track that was devoted to the area of functional programming, a topic that I have a profound interest in. After having followed the track, I'm even more convinced than before that functional programming is not confined the the academic world. I think that it will have a profound impact on our mental perspective and the way we think about programming and problem solving in the next coming years. In this blog, I will summarize the sessions I followed, provide you with a couple of thought provoking ideas that I picked up, and hopefully makes you think about your programming style.

(more...)

  • Share/Bookmark

Tags: Functional Programming, qcon
Filed under Functional Programming, qcon | 1 Comment »

Deployment automation for Java application running on Websphere, WebLogic and JBoss

Archives

  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009

Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India

Categories

  • Java (282)
  • Agile (109)
  • General (50)
  • Testing (42)
  • Performance (42)
  • Hibernate (36)
  • Scrum (33)
  • Podcast (31)
  • Architecture (31)
  • Spring (28)
  • SOA (24)
  • Maven (22)
  • Project Management (22)
  • Middleware (23)
    • Deployment (14)
  • Flex (17)
  • JPA (17)
  • Eclipse (15)
  • Xebia Labs (15)
  • Quality Assurance (14)

Tag Cloud

    Introduction to Agile product owner Hibernate qcon Performance Ajax esb Java JavaOne Maven XML fitnesse IntelliJ Grails Groovy SOA Scala Agile Xebia Closures Agile Awareness Workshop Semantic Web Lean Architecture Poppendieck Spring Seam Functional Programming Testing Scrum