I am trying to design code for this below task :
- First i want to check user is valid or not based on question and answer submitted by user
- If user is valid then i want to check whether there is room available for user for a given date and time
- If room is available then save Booking details in table.
So here i am confused as whether Chain of Responsibility make sense here or not?
If not then why?
If not then this is how i am thinking to design my code because i have been told not to do new
anywhere because we are following DI driven workflow interface driven approach :
IRoomBookingManager :
CheckAvailability()
BookRoom()
IUserManager :
Authenticate()//check user is valid or not based on question and answer submitted by user.
Note : I am learning how to design proper code using Design Patterns if applicable.
Can anybody please help me answer 2 below questions :
1) Whether chain of responsibility make sense here or not and if not then why?
2) What should be the proper code design for this in case if my code structure doesnt make sense?
Aucun commentaire:
Enregistrer un commentaire