Archive for October 24th, 2008



The Repetita Juvant Principle

Welcome to anti-refactoring lesson number 3. The "Repetita Juvant Principle" is the counterpart of the DRY principle: 1 @Override 2 public SomeObject getSomeObject() { 3 return super.getSomeObject(); 4 } 5 6 @Override 7 public void setSomeObject(SomeObject arg0) { 8 super.setSomeObject( arg0 ); 9 } Then, you may think... this code has been written for some [...]

Always on getter and setters

Welcome to anti-refactoring lesson 2. There are painters that paint with pencils or brushes and painter that paints with a bucket. A bucket is very effective if you just want a canvas filled. An example: 1 private String prefix; 2 public String getPrefix(){ 3 return getClass().getPackage().getName(); 4 } 5 public void setPrefix(String prefix) { 6 [...]




About

You are currently browsing the NewInstance weblog archives for the day Friday, October 24th, 2008.

Longer entries are truncated. Click the headline of an entry to read it in its entirety.

Calendar

October 2008
M T W T F S S
« Sep   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Follow me

twitter flickr LinkedIn feed

Enter your email address:

Archives


Categories

Tag Cloud