Goldman Sachs collections – nearly everything you want from collections in Java

Java collection framework is not that powerful as experienced Java developer would expect. For example, how do you sort a list? Simple answer would be to use java.util.Collections.sort() method with some kind of java.util.Comparator implementation. Additionally Guava Ordering support can be used. However, the solution is not exactly what object oriented developer looks for. Similarly to sorting a collection you would probably deal with finding min or max element in a collection using  java.util.Collections.min() and java.util.Collections.max() methods respectively. After all how to

Continue Reading

Measure and find bottlenecks before they affect your users 1/2

Inspired by a few talks during the last 33rd Degree conference I decided to implement, in one of the applications I develop, metrics which allow developers or operation team monitor running application and possibly detect potential problems early on. After a quick investigation I decided to use the Metrics framework. What I expected was exposing at least some statistics concerning usage of application components. First of all I would use them during application stress tests to find particular components slowing down the application. After

Continue Reading

Another useful tool from Zeroturnaround – Xrebel

Some time ago I signed up for a beta testing of a new tool from Zeroturnaround : Xrebel. I have been waiting a bit impatiently for a testing program to start. Finally I have got an information about availability of 1.0.0 version of the tool for download. Without much hesitation I have started tests. What does the tool do? As you may expect, based on previous Zeroturnarond tools, generally speaking it is intended to improve quality of Java developer every

Continue Reading

Java enums + template method design pattern

Let’s consider the following code snippets: [crayon-5a0f6b31bd8fe768255077/]   [crayon-5a0f6b31bd903963937909/] How often do we see much the same scenario? It is not completely wrong since there is a try to use enums so it is not entirely “string driven” programming. However there is still a space to do some refactoring. What about doing such stuff more in the object-oriented way? Enums are very powerful Java feature but for most of the cases there are only used in the simplest possible way.

Continue Reading

Java application performance monitoring

I am going to present quick overview of useful tools which can be helpful when you trying to troubleshoot application in case of performance issues. Describing each tool, some overview is provided, the way the tool is installed, free/paid info, inclusion in the JDK and the information if it can be used in production environment. logs application logs, application server logs, database logs no installation free included with JDK can be used in production application server monitoring administration console provided

Continue Reading

JPA EntityManager operations order

I have run into interesting issue recently. I use in the project JPA + Hibernate + EJB. The issue concerns saving and deleting entities in the same transaction. Database table which is used has an unique constraint defined on two columns. What I have done was removing entity calling [crayon-5a0f6b31bdb13823831268/] then the new entity has been added with the same values in two properties associated with columns used in the unique constraint but different values in other properties using: [crayon-5a0f6b31bdb18351727319/]

Continue Reading

Spring Integration

I have been really impressed by the Spring Integration project recently so I decided to write a few words about it. Just to make a quick introduction: Spring Integration can be described as an extension of the Spring programming model which supports Enterprise Integration Patterns. It enables lightweight messaging within Spring-based applications and supports integration with external systems via declarative adapters. Those adapters provide a higher level of abstraction over Spring’s support for remoting, messaging, and scheduling. In my opinion

Continue Reading

Site Footer