Author Archives: Ghaith Alrabadi

Java 8: Parallel vs Sequential Stream Comparison

Motivated by the introduction of Lambdas in Java 8, I wrote a couple of examples to see how difficult it would be to follow a functional programming paradigm in real production code.

I will demonstrate using some features from Java 8 with a simple and fun example.

Continue reading

How to implement the splitter and aggregator patterns with Apache Camel

I have found that Apache Camel is a good way to load data from log files into a database. Read on to see how I did this using the splitter and aggregator patterns with Apache Camel.

Continue reading

Iterators, Functors and Predicates

In this post I am sharing different ways to create ‘Custom Iterators’ and how to control the behavior of that Iterator.

Also part of this article focuses on how to apply different operations on a selected elements within a custom iterator.

The way to do this is to implement a new Iterator-subclass and pass it Functors and Predicates.

By the way Google has implemented all these and more within the Guava Framework, you just need to include this framework as part of your project.

So what are functors and predicates?

Functor: Functor is an interface implementation that apply an operation or status change on an object passed to it’s operation method.
Continue reading

Parallel Programming With Barrier Synchronization

Parallel Programming is an emerging computer science field that studies the opportunity of splitting data into small chucks and process them on multiple processors simultaneously which provides a faster execution time. Parallel programming is useful in sorting, image processing, network processing and may other memory intensive tasks.
Continue reading