DAO and Data transfer object
问题 So in the Data transfer Object there should be only setters and getters.. However what about handling also inserting and deleting objects from the Data transfer Object? public class dto{ setters and getters... .. .. public void delete(){ CustomreDao.delete(this.ID); } } Would it be against the DAO pattern itself? Thanks in advance. 回答1: Ask yourself this: "how hard would it be to update the DAO's delete method?" If you have a lot of DTOs and suddenly need to change the DAO, then that's a lot