For instance, I have a class named Car which contains of two fields of type AdminPart and PassengerPart correspondingly.
For client code using my code I want the client code to be able to do car.getLicense() and not car.getAdminPart().getlicense() . This of course is implemented as getlicense() in Car which in turn calls the relevant getter. Same for setters.
Is there a best practice for this? Something I've overlooked ? Thanks :-)
Aucun commentaire:
Enregistrer un commentaire