A software engineering blog mainly focused on programming, web development and testing

Posts

  • Grouping, transforming and reduction with Java 8

    In this previous post, I wrote about how we can group collections of objects with streams and grouping. This is useful but does not cover specific use cases. For example, sometimes we do not only need to group things but also transform the result into a more appropriate object.

    In this post, we will learn how to...

  • Multi level grouping with streams

    With Java 8 streams it is pretty easy to group collections of objects based on different criteria. In this post, we will see how we can make stream grouping, from simple single level groupings to more complex, involving several levels of groupings.

    We will use two classes to represent the objects we want to group by: person and pet.

    Person.class

    ...
  • Understanding Callable and Spring DeferredResult

    Asynchronous support introduced in Servlet 3.0 offers the possibility to process an HTTP request in another thread. This is specially interesting when you have a long running task, since while another thread processes this request, the container thread is freed and can continue serving other requests.

    This topic has been explained many times, but there seems to be a little...

  • Improving performance: non-blocking processing of streams

    Imagine we have an application that needs to access an external web service in order to gather information about clients and then process it. More specifically, we can’t get all this information in a single invocation. If we want to look up different clients, we will need several invocations.

    As shown in the graphic below, the example application will retrieve...