java - Public Fields in DTO and Domain object -


I am reviewing the code for a project. This architecture is available on the following plan:

system architecture

At this time DTO - Simple POJO and Domain - Hibernate includes annotation. As I know that one of the benefits of using DTO is that you can make all domain areas as public and remove all the stub codes with gates and setters. Is this the right way?

What do you think about exiting the DTO and removing the setters? Maybe some professionals can be applied to DTO in Groovy?

What do you think about it?

I will use JavaBin because:

  1. Open -Source support groups that work with jababins like determining the value of the property whose name is unknown to runtime.

  2. There are times when you have to make simple data changes. Gates and satellars can do this transparently.

  3. You can see the data "syntax" like if a field is not empty, then throw a null pointer exposition.

    In any way, do not mix public areas with Zawabones, it will confuse everyone with stupid.

Comments