In a java project, I have several XXXService.java
interfaces in a package which only contains the interfaces serve as the public API. In another package I have the implementation classes for each interface in the previous package, naming like XXXServiceImpl.java
. I think it's quite a common pattern that we use in when designing public APIs.
Here I just wonder if it's good practise to have the implementation class serializable. Because I have some datas need to be serialized(several HashMaps for example) which are initialized in the implementation classes. Of cause I can move those datas into another seperate class containing only resources to be persisted. I just want to know what would you do in such a situation. What's the consideration when you say it's good or not?
I am junior and interested in the good programming practises. ;) Or any books to recommend?
Aucun commentaire:
Enregistrer un commentaire