mardi 26 avril 2022

Business logic inside of value object

I think value object should not have business logic.

That maybe confused other programmers.

for exmaple,

public class PersonVO {

    private String name;
    private int age;

    public void somethingBusinessLogic() {
        // Do very complecated logic -> Using Reflection, Conversion
    }
    
}

If i use this VO, have to look vo logic how to work.

many of programmers put their business logic inside of VO.

I wonder what is best practice?

Aucun commentaire:

Enregistrer un commentaire