Coupling: The factory method

One of the challenges we face with coding is dealing with coupling. Coupling is an important aspect of programming, it tells us how much our code is tangled. When coupling is too high, we can’t easily re-use code. When the coupling is too low it does little. You can measure coupling, there are several metrics […]

My answer for – What is wrong with this code #02

A lot of things can be found in the snippet at “What is wrong with this code #02″. Here it is again: [sourcecode language=”java”] public MyObject { private String myField; … (imagine multiple fields) … public GenericObject toGenericObject() { GenericObjectFactory genericObjectFactory = GenericObjectFactory.getInstance(); GenericObject genericObject = genericObjectFactory.create("myObject"); genericObject.setField("myField", myField); // imagine multiple lines using genericObject.setField("field", […]

Regression – Lets stop it!

I hate it. You change something and you can’t tell if your change broke something in the system. If you’re lucky, you did not break anything. Or nobody noticed it. Next to that, on the same scale of luck, the potential bugs are found in the manual testing phase. But often there is no time […]