How to name multi-setter?

Posted by IAdapter on Programmers See other posts from Programmers or by IAdapter
Published on 2011-11-14T13:15:54Z Indexed on 2011/11/14 18:11 UTC
Read the original article Hit count: 237

Filed under:
|
|
|

I'm struggling with how to name this method, I don't like the "set" prefix, because I feel it should be reserved for normal "dumb" setters and some tools might not like it (i did not check it in checkstyle, pmd, etc., but I got a feeling they won't like it.)

for example (in java, but I feel its language agnostic)

public void setField1Field2(String field1, String field2) {
    this.field1 = field1;
    this.field2 = field2;        
}

The only purpose of this method is ONLY to set, this method is needed and cannot be joined with any other (because of framework used).

© Programmers or respective owner

Related posts about java

Related posts about design