Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

and many more ....

Grails: Calling bean methods in Spring Security expressions

grails-logo

Some days ago while working on a Grails application I was in a situation where a wanted to call a bean method from a Spring security SPEL expression. I was using the @PreAuthorize annotation from the Spring Security ACL plugin and wanted to do something like this:               @PreAuthorize("myService.canAccessUserProfile(#profileId)") public Profile getUserProfile(long profileId) {   ... } @PreAuthorize takes ...

Read More »

@ControllerAdvice improvements in Spring 4

spring-interview-questions-answers

Among many new features in Spring 4 I found @ControllerAdvice improvements. @ControllerAdvice is a specialization of a @Component that is used to define @ExceptionHandler, @InitBinder, and @ModelAttribute methods that apply to all @RequestMapping methods. Prior to Spring 4, @ControllerAdvice assisted all controllers in the same Dispatcher Servlet. With Spring 4 it has changed. As of Spring 4 @ControllerAdvice may be ...

Read More »

Using serialization to find dirty fields in an object

java-logo

Say you are developing a framework to auto-save objects into a database. You need to detect changes made between two saves, so that only modified fields are saved. How to detect dirty fields. The easiest way to do this is to traverse through the original data and the current data and compare each field separately. Code as below:     ...

Read More »

Oracle GlassFish, or Why You Should Think About Open Source Again

oracle-glassfish-logo

Oracle’s recent announcement about the discontinuation of commercial services for JEE’s reference implementation GlassFish has caused many reactions in the community involved with JEE. The reactions reach from: Markus Eisele’s rather pessimistic outlook on JEE’s future in general Adam Bien’s constructive (or cynical? With Adam Bien, you can never be sure) suggestions of moving GlassFish over to GitHub Tomitribe’s pragmatic ...

Read More »

Ceylon 1.0.0 is now available

ceylon_logo

Today, we’re proud to announce the first production release of the Ceylon language specification, compiler, and IDE. Ceylon 1.0 is a modern, modular, statically typed programming language for the Java and JavaScript virtual machines. Ceylon enables the development of cross-platform modules that execute portably in both virtual machine environments. Alternatively, a Ceylon module may target one or the other platform, ...

Read More »

Why we shouldn’t use more threads than we need to

java-logo

Overview There is a common argument that because we have lots of cores, and will have even more in the future we have to use them.  We just we need to find the best ways to use them but just because we can doesn’t mean we should. What is our goal? Good reasons to use multiple threads are   the ...

Read More »

Lambdas for Fluent and Stable APIs

java-logo

A few weeks ago I wrote an introduction on Java 8 lambdas. In this introduction I explained what a lambda is and how to use them in conjunction with the new Stream API, that is also introduced in Java 8. The Stream API provides a more functional interface to collections. This interface heavily depends on lambdas. But there’s much more ...

Read More »

ID Lists Aren’t the Best Solution for the N+1 Problem

jboss-hibernate-logo

In their eternal attempts to circumvent the N+1 problem, Hibernate users often resort to IN predicates with ID lists. In this post, we’ll see how those users might just be replacing a horrible thing with a bad one, which is better but not yet good. Here’s why: The N+1 Problem The N+1 problem is a well understood issue, documented in ...

Read More »

Customization in Saas using Plug and Play Architecture

software-development-2-logo

There exists a lot of design patterns, architectures and design concepts that can be applied to technical aspects of implementing a product. For eg., we have MVC architecture that isolates the view, controller and model of the application. We have a factory pattern that defines how to create objects and so on. Yet, these all limit themselves to the technical ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close