Question
I am trying to implement the Command pattern to my Library System. I have created a BorrowItem command so that the Screen/Invoker will be able
I am trying to implement the Command pattern to my Library System. I have created a "BorrowItem" command so that the Screen/Invoker will be able to get an Item from the Library. For the receiver, I have put my "Item" class which has a +getItem() method to access an Item from the repository class.
I chose Librarian as the client because it controls the command execution process and the screen as the invoker because it executes without knowing the implementation.
I am just unsure if the Item class is a good option for being the receiver. I understand that a receiver is what performs the set of actions and since it has the getItem() method, I thought the Item class would make the most sense. Thank you for the help!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started