It's not always what you think it is.

Once in awhile I needed to plug some third-party module into our project. Despite Spring makes it extremely simple in terms of design, an actual plugging may give you a plenty of headache at the moment you realise it does not behave as you expect. The trick was that the module had XML context configuration, while we used to employ JavaConfig...

In this part of the series, we shall review Spring's bean loading process in details for both XML and Annotation contexts. Bean overriding, extension points, custom per-project defaults, and all this stuff are actually not that hard if you know where to look.

Read further
Created 10/10/2017, 6:25:03 AM

If you try hard enough, it will accidentally start working.


For the long time, Spring has been a de-facto leader amongst Java application containers. Spring Project has tons of code, libraries, extensions, and services around, a monstrous and fearsome infrastructure I was afraid of even taking a look into. And from this idea alone, I thought of Spring Context as of the same monstrous entity the whole Project is. But it is not. Looking back, I realised there were much more effective ways of doing many things. Then there was a moment when I decided to stop "putting out flames" and thus to resolve the very core of my Spring-related problems: I didn't know how it works. As the time was coming, it turned out that the basic context is a simple and somewhat elegant extensible solution, and it actually takes a day or two to known it well enough for our every-day needs. For them who have not yet become brave enough to step onto the steep Spring Context's learning curve this series is made.

Read further
Created 6/4/2017, 7:38:36 PM

"Scala EE" or "Probably the fastest way to get hated by both functional programmers and enterprise devs"

Java is old. It's really, really old. In fact, most of today's students did not exist by the time it were released. Still, Java is the most popular enterprise language ever, and Java EE makes it even better providing centralized way of creating all the environment your application is intended to be run in. But it's still old. Java works well for kinda old-minded people like me: I'm okay with declarations like the following:

public class Task implements Callable<String>, Serializable {
    public String call() {
        String result = doSomething();
        return result;

If you agree the snippet above is good, then...

Read further
Created 4/30/2016, 6:22:12 PM

We have an annotation for this!

When once annotations has been introduced, they used to be just a metadata storage for the real code developers would write. Java EE Contexts and Dependency Injection mechanism it not well-known yet, but allows quite easy and exciting annotation-driven injections of POJOs in managed beans. No more constructor based injections, no ladder-styled signatures and dependency hell, CDI will handle everything in a simple declarative manner.

Read further
Created 5/4/2015, 8:25:12 PM

During the JTorrentier project development I was in need of a fast TCP/UDP sockets interface for Enterprise JavaBeans. I had firstly discovered a JCA-sockets project, but it's kind of weird: one utilizes synchronous IO by blocking one of WorkManager threads and it seems that its author has weird understanding of Java Connector Architecture.

SocketConnector is created from scratch by using only JCA specifications as a guidance. It runs Netty 4.x and performs asynchronous TCP IO with clear and reliable client interface (through JCA resource adapter standard mechanisms: ConnectionFactory for outbound IO and message-driven beans for inbound one). It also guarantees connections closing on client application undeploying which lowers maintenance costs and simplifies client code. As a JCA-compliant resource adapter this project may also be used as a reference Java connector implementation

Read further
Created 4/4/2015, 12:17:40 AM

Even the best of us sometimes must write in C#

Last month I was working on the File Watcher application. It's a WPF-based file system changes watching software written in C#. The main goal was to make cataloguing easier by providing filter-based file system changes watcher with copy/move reactions. This is also a forerunner of the JTorrentier BitTorrent client I'm going to release later this year.

Read further
Created 1/31/2015, 11:10:11 AM

My colleague asked me if it there a printf-like function in C/C++ which would provide him a way of printing array of various values according to some format line. No function has been found so far, but aren't we DEVELOPERS ourselves?

There's a System V 64-bit ABI compatible function which takes a format string, list of arguments, and passes them into the libc sprintf function.

Not safe for work

The code below is dangerous and should NEVER be used not only in production environment but also not 50 miles closer to any of social infrastructure objects.

Read further
Created 6/26/2014, 9:52:29 PM

Roman Nazarenko

Senior full stack wizard, open source developer & debugger Jedi