Blog: Java and neighbourhood

Custom Spring namespaces made easier with JAXB

First of all, let me tell this out loud: Spring is no longer XML-heavy. As a matter of fact you can write Spring applications these days with minimal or no XML at all, using plenty of annotations, Jav...

Wyświetlenia 991

OK 0

NOK 0

Three flavours of request-response pattern in Akka

Imagine a simple Akka actor system consisting of two parties: MonitoringActor and NetworkActor. Whenever someone (client) sends CheckHealth to the former one it asks the latter by sending Ping. Networ...

Wyświetlenia 404

OK 0

NOK 0

Turning Twitter4J into RxJava's Observable

North of OsloaTwitter4J is a Java wrapper around Twitter API. While Twitter supports simple request-response interactions in this article we will explore streaming APIs. In contrary to request-respons...

Wyświetlenia 307

OK 0

NOK 0

Proxies done right with Guava's AbstractInvocationHandler

SnarøyaNot too often but sometimes we are forced to write custom dynamic proxy class using java.lang.reflect.Proxy. There is really no magic in this mechanism and it's worth knowing even you will neve...

Wyświetlenia 303

OK 0

NOK 0

Promises and CompletableFuture

From meetup.comDuring my talk at Warsaw Java Users Group about functional reactive programming in Java a few interesting questions came up regarding CompletableFuture capabilities. One person was int...

Wyświetlenia 481

OK 0

NOK 0

Playing with Scala futures

View from KolsåstoppenDuring job interviews we often give Scala developers a simple design task: to model a binary tree. The simplest but not necessarily best implementation involves Option idiom:case...

Wyświetlenia 472

OK 0

NOK 0

brainfuck in Clojure. Part II: compiler

OslofjordLast time we developed brainfuck interpreter in Clojure. This time we will write a compiler. Compilation has two advantages over interpretation: the resulting program tends to be faster and s...

Wyświetlenia 387

OK 0

NOK 0

brainfuck in Clojure. Part I: interpreter

Snarøya coastBrainfuck is one among the most popular esoteric programming languages. Writing a Brainfuck interpreter is fun, in contrary to actually using this "language". The syntax is dead simple an...

Wyświetlenia 348

OK 0

NOK 0

"Beginning Java EE 7" by Antonio Goncalves review

Don't be fooled by the "beginning" in the title. This 600-pages book is a comprehensive and complete walk-through of all components and technologies comprising Java EE 7 stack. Antonio Goncalves, Java...

Wyświetlenia 379

OK 0

NOK 0

instanceof operator and Visitor pattern replacement in Java 8

Bridge to UlvøyaI had a dream where instanceof operator and downcasting were no longer needed but without clumsiness and verbosity of visitor pattern. So I came up with the following DSL syntax:O...

Wyświetlenia 400

OK 0

NOK 0

Optional in Java 8 cheat sheet

Maridalsvannetjava.util.Optional<T> in Java 8 is a poor cousin of scala.Option[T] and Data.Maybe in Haskell. But this doesn’t mean it’s not useful. If this concept is new to you, imagine Optiona...

Wyświetlenia 510

OK 0

NOK 0

Asynchronous retry pattern

Office building in FornebuWhen you have a piece of code that often fails and must be retried, this Java 7/8 library provides rich and unobtrusive API with fast and scalable solution to this problem:Sc...

Wyświetlenia 764

OK 0

NOK 0

Managing congested actors in Akka

HovedøyaThere comes a time in an Akka application when an actor can longer handle increasing load. Since each actor can only handle one message at a time and it keeps a backlog of pending messages in ...

Wyświetlenia 404

OK 0

NOK 0

Fake system clock pattern in Scala with implicit parameters

SjømannsskolenFake system clock is a design pattern addressing testability issues of programs heavily relying on system time. If business logic flow depends on current system time, testing various flo...

Wyświetlenia 367

OK 0

NOK 0

Macro lifecycle in Clojure

Oslofjord from SnarøyaIf you still struggle to understand what are macros in Clojure and why are they so useful, I will guide you through another example today. We will learn when macros are recognize...

Wyświetlenia 517

OK 0

NOK 0

su and sudo in Spring Security applications

KolsåstoppenLong time ago I worked on a project that had a quite powerful feature. There were two roles: user and supervisor. Supervisor could change any document in the system in any way while users ...

Wyświetlenia 566

OK 0

NOK 0

Clojure macros for beginners

BjørvikaThis article will guide you step-by-step (or even character-by-character) through the process of writing macros in Clojure. I will focus on fundamental macro characteristics while explaining w...

Wyświetlenia 465

OK 0

NOK 0

Mapping enums done right with @Convert in JPA 2.1

TorshovdalenIf you ever worked with Java enums in JPA you are definitely aware of their limitations and traps. Using enum as a property of your @Entity is often very good choice, however JPA prior to ...

Wyświetlenia 912

OK 0

NOK 0

Null safety in Kotlin

Gjersjøen lakeKotlin is a statically typed JVM language developed by Jetbrains. It has some good documentation so today I will focus on a tiny part of it - null safety.There are at least couple of app...

Wyświetlenia 380

OK 0

NOK 0

Lazy sequences implementation for Java 8

I just published LazySeq library on GitHub - result of my Java 8 experiments recently. I hope you will enjoy it. Even if you don't find it very useful, it's still a great lesson of functional programm...

Wyświetlenia 495

OK 0

NOK 0

Polskie blogi o JAVIE

                                                                                                                                       

dailylog

Wpisów: 34

Ostatni (2014-10-06):
PageLogic

    

jdn.pl

Wpisów: 163

Ostatni (2015-01-09):
Chamberconf