Skip to content

2016

Impl classes are evil

Like Martin Fowler said in TwoHardThings:

There are only two hard things in Computer Science: cache invalidation and naming things.

I've just seen too many times developers using Dependency Injection frameworks like Spring or Guice or Dagger the wrong way. Naming classes with Impl suffix is an Anti-pattern and i'm going to explain why.

Why Impl is Bad

ServiceImpl is a common practice

Many developers, including myself years ago, are using the Interface + Impl pattern to create services which are injected by their interface. This usually looks like this:

Impl pattern

Monitoring in action: Apache Httpd

This blog post is a step-by-step guide for monitoring Apache Httpd using OctoPerf. We use WordPress as a sample application.

Prerequisites

Before monitoring an infrastructure we need:

  • to install WordPress using Docker,
  • to configure an on-premise Host,
  • and to create a virtual user that browse the different pages.

You can skip to the monitoring chapter if you are familiar with these steps or directly to the analysis to get the results.

OctoPerf built-in monitoring

At the root of the OctoPerf project is the will to provide realistic load testing. We continue to take steps to improve the JMeter experience and make it accessible. But there's a limit to what pure performance testing can achieve.

To push this limit it is vital to assess what happens on the hardware during the tests.

More realism

Of course, a realistic test must reproduce the users expected behavior, but that's not all. Once your test is running you need to know what is happening to your servers if you want to fix bottlenecks. This is something that always bothered us when launching only the load from OctoPerf.

Server Monitoring

Sometimes a feature changes everything.

Over the past year, you have been numerous to try OctoPerf, to use it for your testing projects and to share about it. We want to thank you for your amazing support! Your confidence has given us the energy to grow and to develop new features.

Today, we are proud to announce you we released a major functionality for your tests: The server monitoring.

The builder pattern

The builder software design pattern is an object creation one. It's a great building block for classes with optional fields. It provides a maintainable and readable way to instantiate immutable classes with more than 3 or 4 fields. It greatly reduces the time developers needs to understand how to instantiate the class properly.

You have surely faced one day or another a code similar to the one below.

public class Person {
  private final String firstname;
  private final String lastname;
  private final String address;
  private final String zipCode;

  public Person(final String firstname, final String lastname) {
    this(firstname, lastname, "");
  }

  public Person(final String firstname, final String lastname, final String address) {
    this(firstname, lastname, address, "");
  }

  public Person(final String firstname, final String lastname, final String address, final String zipCode) {
    this.firstname = Preconditions.nonNull(firstname);
    this.lastname = Preconditions.nonNull(lastname);
    this.address = Preconditions.nonNull(address);
    this.zipCode = Preconditions.nonNull(zipCode);
  }
}