In order to have tested more readable and easy to write I usually use the BuilderPattern
in my value object. For example instead of writing this simple class in a standard way:
public class MyClass{
private String myProperty;
public void setMyProperty(String myProperty){
this.myProperty = myProperty;
}
}
I prefer to write it as follows:
public class MyClass{
private String myProperty;
public MyClass setMyProperty(String myProperty){
this.myProperty = myProperty;
return this;
}
}
Could this approach has a bad effect on performance?