Home » Author Archives: Jakub Kubrynski

Author Archives: Jakub Kubrynski

I'm software developer by vocation. Java team leader at work and open source enthusiast at home. Strongly interested in new technologies. Fan of java.util.concurrent and sun.misc.Unsafe. My motto is "minimum code, maximum functionality.

Smart package structure to improve testability

java-logo

There are many ways of dividing whole application into packages. Discussions about pros and cons of packaging by feature or by layer can we found on many programming blogs and forums. I want to discuss this topic starting from testability and see if it will drive to any meaningful result. At the beginning let’s try to describe what we usually ...

Read More »

JPA in case of asynchronous processing

java-interview-questions-answers

Few years ago in Java world it was almost obvious that every “enterprise” class project needed JPA to communicate with database. JPA is a perfect example of “leaky abstraction” described by Joel Spolsky. Great and easy at the beginning but hard to tune and limiting at the end. Hacking and working directly with caches, flushes and native queries is a daily ...

Read More »

Do we really still need a 32-bit JVM?

java-logo

Even today (and it’s 2015) we have two versions or Oracle HotSpot JDK – adjusted to 32 or 64 bits architecture. The question is do we really would like to use 32bit JVM on our servers or even laptops? There is pretty popular opinion that we should! If you need only small heap then use 32bits – it has smaller memory ...

Read More »

Using jstat to report custom JVM metric sets

java-logo

I’ve always been missing possibility to configure custom headers in JStat. Of course there are a lot of predefined data sets, but it’ll be nicer if we could create our own data set. And as you probably already devised I’m writing this post because such functionality is of course available :) Unfortunately I haven’t found it in any documentation so ...

Read More »

Dependency injection pitfalls in Spring

spring-interview-questions-answers

There are three injection variants in Spring framework: Setter-based injection Constructor-based injection Field-based injection Each of those mechanisms has advantages and disadvantages and there is not only one right approach. For example field injection:      

Read More »

Need micro caching? Memoization to the rescue

java-logo

Caching solves wide sort of performance problems. There are many ways to integrate caching into our applications. For example when we use Spring there is easy to [email protected] support. Quite easy but we still have to configure cache manager, cache regions, etc. Sometimes it’s unfortunately like taking a sledgehammer to crack a nut. So what can we do to “go lighter”? ...

Read More »

Debugging OpenJDK

openjdk-logo

Sometimes debugging Java code is not enough and we need to step over the native part of Java. I spent some time to achieve proper state of my JDK to do that, so short description probably will be useful for ones starting their trip. I’ll use the brand new OpenJDK 9! At first you have to obtain main repository by ...

Read More »

Understanding Spring Web Initialization

spring-interview-questions-answers

Few years ago majority of us were used to write XML config files everywhere, to setup even simple Java EE application. Today using Java or Groovy to configure projects is becoming preferred way – you just need to take a look at Gradle or functionalities introduced in further versions of the Spring Framework to gen up on this. Now I’ll ...

Read More »

Injecting Spring beans into non-managed objects

spring-interview-questions-answers

Advantages coming from dependency injection can be addicting. It’s a lot easier to configure application structure using injections than doing all resolutions manually. It’s hard to resign from it when we have some non-managed classes that are instantiated outside of the container – for example being part of other frameworks like Vaadin UI components or JPA entities. The latter are ...

Read More »

Using HA Singleton in JBoss 7

jboss-logo

Some time ago I had to change standard clustering behavior of Quartz Scheduler, and let it work without synchronizing over database. There are of course a lot of options to do that, but because I’m big fan of simplicity I’ve decided to use standard Spring @Scheduled configuration and totally skip thinking about cluster at this level. The idea was to ...

Read More »

Want to take your Java skills to the next level?

Grab our programming books for FREE!

Here are some of the eBooks you will get:

  • Spring Interview QnA
  • Multithreading & Concurrency QnA
  • JPA Minibook
  • JVM Troubleshooting Guide
  • Advanced Java
  • Java Interview QnA
  • Java Design Patterns