this is a blog by Jeff Perrin, a software developer based in calgary alberta

Responsibilities of Objects

Here's a quick refactoring tip.

Try to turn something like this...

public class Facility{ private boolean isGasBaseProduct(MeasurementPoint measurementPoint) { return measurementPoint.getProduct().isGas() || measurementPoint.getProduct().isGasLiquid() || measurementPoint.getProduct().isGasByProduct(); } }

...into this:

public class MeasurementPoint{ private boolean isGasBaseProduct() { return getProduct().isGas() || getProduct().isGasLiquid() || getProduct().isGasByProduct(); } }

Laws of the Internet

This Just In…