However, more user types can be added is also the requirement. It is not suitable to add more elements in the visitor pattern. What design pattern should I choose instead? Thanks!
Hi, I'm dealing with a design pattern problem: In a library system, admin can grant the certain permission of user information management (e.g., creating or searching user info) to other departments or schools. So I tried to use the visitor pattern. Users like teachers and students are the subclass of User and the admin or other department is the visitor.
Aucun commentaire:
Enregistrer un commentaire