Page 1 of 1

About Question enthuware.ocpjp.v11.2.3411 :

Posted: Mon Apr 12, 2021 9:45 pm
by alfredo.zuloaga
If the guideline said Guideline 5-1 / INPUT-1: Validate inputs

what is the purpose of
private boolean validate(BalanceSheeData bsd){ //check validity and return true false accordingly }

is not validate before of use ?
public void process(BalanceSheeData bsd){
if(validate(bsd)) { doSomething(bsd.clone()); }
}

Re: About Question enthuware.ocpjp.v11.2.3411 :

Posted: Mon Apr 12, 2021 11:25 pm
by admin
Sorry, I did not understand your question.
The correct option (option 1) is talking about cloning the object before validation. So, you clone the input object, and use that clone for validation and further use.