All Questions
3 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 ...
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 ...
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 ...