Skip to main content

All Questions

6 votes
4 answers
35k views

A DTO class having an ArrayList of its own type - is this considered a good design?

I came across a DTO class like the below one. class PersonDTO { private String firstName; private String middleName; private String lastName; private String dob; // some 50 fields ...
madan's user avatar
  • 127
11 votes
2 answers
11k views

Is an interface with only getters a code smell?

(I've seen this question, but the first answer goes about auto properties more than about design, and the second one says hide the data storage code from the consumer, which I'm not sure is what I ...
user3748908's user avatar
  • 1,657
31 votes
9 answers
31k views

Are init() methods a code smell?

Is there any purpose for declaring an init() method for a type? I'm not asking whether we should prefer init() over a constructor or how to avoid declaring init(). I'm asking if there is any ...
Dioxin's user avatar
  • 953