Source Allies Logo

Blog Insights

  • development icon

    Code Quality Metrics with Sonar, Part I

    I was fortunate to be able to attend the 2011 edition of No Fluff Just Stuff. One of my favorite presentations was by Matthew McCullough on Sonar. Hence, when the issue of code metrics was raised at a partner, Sonar seemed like the right tool to use. Our partner wanted to explore ways...
  • default icon

    Portlet Development using JSF, PrimeFaces and Spring

    This article presents techniques on how to develop Java Portlets using JavaServer Faces, PrimeFaces and Spring. This hands-on example will integrate all of these technologies into a single application. <!-- Spring Web --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <!-- Portlet --> <dependency> <groupId>javax.portlet</groupId> <artifactId>portlet-api</artifactId> <version>${portlet-api.version}</version> <scope>provided</scope><!-- Prevents addition to war file --> </dependency> <!-- Servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>${servlet-api.version}</version> <scope>provided</scope><!-- Prevents addition to war file --> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> <scope>compile</scope> </dependency> <dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> <version>1</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId> <version>2.1.6</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.1.6</version> </dependency> <!-- EL --> <dependency> <groupId>com.sun.el</groupId> <artifactId>el-ri</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> <!--...
  • development icon

    Parallel Programming With Barrier Synchronization

    Parallel Programming is an emerging computer science field that studies the opportunity of splitting data into small chucks and process them on multiple processors simultaneously which provides a faster execution time. Parallel programming is useful in sorting, image processing, network processing and may other memory intensive tasks. For parallel program execution...
  • Close-up of hand holding cell-phone

    Mobile Grails

    I threw out iWebKit immediately because it only targets iPhone, iPod Touch and iPad. While iUI "now supports most smartphones & tablets" it's current version is 0.40alpha1. Furthermore the Grails plugin doesn't appear to have been updated in the past 2 years. This left me with Spring Mobile Grails and jQuery...
  • development icon

    Injecting Spring Beans into Java Servlets

    If you are working in a Java Web Application and you are using Spring IoC Container in your application, there is a chance that you might have to inject Spring Beans into a Java Servlet. Since there is not a direct way to inject Spring Beans into a Java Servlet, you...
  • development icon

    Static Caching in Drupal

    If you’re a PHP veteran, then you know static caching is a relatively simple thing to do in PHP, but it can result in inconsistent behavior and sloppy code, such as adding an extra parameter to a function for the sole purpose of resetting that function’s internal cache. Drupal’s static caching...
  • development icon

    Hibernate Date vs Timestamp

    I encountered a subtle hibernate mapping issue involving Dates and Timestamps. The following test recreates this issue. package com.sourceallies.logging; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.sql.Timestamp; import java.util.Calendar; import java.util.Date; import java.util.List; import javax.annotation.Resource; import org.apache.commons.lang.time.DateUtils; import org.hibernate.Criteria; import org.hibernate.SessionFactory; import org.hibernate.classic.Session; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; import org.springframework.transaction.annotation.Transactional; import com.sourceallies.Person; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration @TransactionConfiguration(defaultRollback=false) public class HibernateDateTimeTest { @Resource ...
  • development icon

    Hibernate Logging

    Through the years I've encountered a recurring requirement. Partners need to log changes to the database for auditing and legal purposes. To satisfy this requirement you could add logging to every save/update/delete call in your code. Or better yet, you could create an aspect that wraps these...
  • development icon

    Back to Basics: hashCode() & equals()

    So we all know that if we implement equals() we must override hashCode() too. But why? The best explanation of this commandment can be found in Effective Java (2nd Edition) starting on page 45. If you're like me, you like to see a problem in running code....
  • agile icon

    Next Step in Agility

    I often find that teams that have adopted Agile practices quickly plateau. They often start by scheduling a daily stand up, planning in iterations, take time for a retrospective, and modify their estimation process. These are common first steps in the agile adoption process. Teams have varied success and commitments...