Beanoh.NET : Spend Less Time Verifying Spring.NET contexts

October 4th, 2012 by Akrem Saed No comments »

I Love Dependency Injection But ….

I’ve burned myself so many times with dependency injection in the past. It make me nervous when I see a complex software product comprised of multiple projects and dozens of libraries without any comprehensive test that double checks the wiring. As our wiring grows and changes over time we need to continuously verify that everything works together. Dependency injection is one of the most valuable patterns in software development. Spring.NET is a necessity in today’s world and has great power that we need to harness in our products. With software products getting bigger and bigger, Spring.NET turns into a double edged sword that can hurt us especially if we cannot prove that every object is wired properly.

Beanoh.NET is a powerful tool for designing and maintaining Spring.NET configurations. One time I had an object named “messageSender” and that object controlled an HTTP connection to a web service by specifying a timeout for connecting and reading the HTTP stream. One day I needed to up the read timeout but for the life of me I couldn’t figure why the call was timing out after 15 seconds even though I’ve increased the timeout to 30 seconds. I spent hours looking into the documentation of the HTTP sender and debugged the code to no avail. In a moment of despair, I ran an Agent Ransack search through the whole web application package for the word “messageSender” and found two objects with that name one with 15 seconds timeout and the other with 30 seconds timeout. Each pulled from a different library. Wouldn’t it be awesome if my continuous build failed with a message saying “a duplicate object definition was found with the name of ‘messgeSender’. Are you sure you want them overriding each other ? ” If I was using Beanoh.NET it could have identified this duplicate bean.

» Read more: Beanoh.NET : Spend Less Time Verifying Spring.NET contexts

Iterators, Functors and Predicates

August 24th, 2012 by Ghaith Alrabadi No comments »

In this post I am sharing different ways to create ‘Custom Iterators’ and how to control the behavior of that Iterator.

Also part of this article focuses on how to apply different operations on a selected elements within a custom iterator.

The way to do this is to implement a new Iterator-subclass and pass it Functors and Predicates.

By the way Google has implemented all these and more within the Guava Framework, you just need to include this framework as part of your project.

So what are functors and predicates?

Functor: Functor is an interface implementation that apply an operation or status change on an object passed to it’s operation method.
» Read more: Iterators, Functors and Predicates

Multi-Step Forms in Django

April 13th, 2012 by Arlan Whatling 7 comments »

Forms in Django seem to be a relatively advanced topic if you want to do anything outside of models.  Case in point: I had to develop a multi-step form in django that would spit out a certain result.  There were only two forms that the user needed to fill out, but the second form had to change what fields it had based on the input from the first form.  Also, the form did not save anything to the database; it just created a file for the end user to download.  To solve this problem, I did research.  A lot of research.  And like any good technical topic, the information I needed was all over the place on the Internet.

» Read more: Multi-Step Forms in Django

Automated Testing Strategy for Legacy Systems

April 1st, 2012 by David Kessler 1 comment »

Once you catch the automated testing itch you want to write test for everything. But should we use the same strategy for every piece of software? The conclusion that I’ve come to is no. While I’m completely committed to the practice of TDD and aggressive test coverage, I’ve found that legacy software needs to be approached strategically.
» Read more: Automated Testing Strategy for Legacy Systems

Code Quality Metrics with Sonar, Part I

March 5th, 2012 by Akrem Saed 4 comments »

What is Sonar and Why it’s Needed?

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 client, Sonar seemed like the right tool to use.

Our client wanted to explore ways to measure and enforce software and code quality metrics. Their goals were to have quantitative measurements of their code quality and analyze those metrics to come up with a set of benchmark measurements. They wanted to utilize Sonar to discourage bad practices.

» Read more: Code Quality Metrics with Sonar, Part I

Portlet Development using JSF, PrimeFaces and Spring

March 1st, 2012 by Lal Sah 3 comments »

About the Post:

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.

Assumptions

This post assumes that you have a basic understanding of Portlet, JSF, PrimeFaces and Spring. And a good understanding of Java 5 and annotations.

Resources

Before getting started, please have the following downloaded and setup in your environment.

» Read more: Portlet Development using JSF, PrimeFaces and Spring

Parallel Programming With Barrier Synchronization

March 1st, 2012 by Ghaith Alrabadi 4 comments »

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.
» Read more: Parallel Programming With Barrier Synchronization

Mobile Grails

March 1st, 2012 by David Kessler 7 comments »

Background

I was recently asked to throw together an application that would register and score a model car race. I went home and created a Grails app. Unfortunately this race will be held in a building that doesn’t have internet access. So I tried to keep my pages compact and clean so they could be used on mobile phones.

» Read more: Mobile Grails

Injecting Spring Beans into Java Servlets

February 23rd, 2012 by Lal Sah 4 comments »

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 might try to lookup the Spring Beans from the Spring Context within your servlet and assign the dependencies which means that part of injection would no more be IoC and you would be looking for some concise way of doing this.
» Read more: Injecting Spring Beans into Java Servlets

Static Caching in Drupal

February 6th, 2012 by Arlan Whatling 1 comment »
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 system improves upon the old way by providing a simple and consistent way for creating your own cache store and resetting cache stores set by other systems within Drupal.  The entire functionality of this system is wrapped up in the drupal_static() function, with a side function, drupal_static_reset(), for resetting any existing cache store.
» Read more: Static Caching in Drupal