This is in continuation to part 1 , we have already seen how to come up think about use cases and create a class diagram. Now in this blog I will cover activity diagram and the actual c++ code.
Activity diagrams :
Here we think about some use cases and how the control flows in it ( Check here for meaning of various symbols used in diagram). Here main use cases are : Borrow an item, Return an item.
Borrow an item : In our library how will anyone borrow an item ? First a member shares his id or name by a library card to librarian, then will request for an item by saying id or barcode, Librarian will check for any fines or status of account then librarian will check on the system if the item is not issued and not reserved and if the number of items which can be issued are not max yet. Then item issue details will be updated in the system and member will be given the item. If its not available but there is no reservation on the item, then librarian tells member about the option to reserve, in which case the reservation status for that item will be updated and member will be notified in future when the book is available.
Return an item : Member gives the item to librarian. Librarian checks the barcode or id on the item. Librarian fetches the item issue details and checks for fine. If any fine collects it. Then updates the item issue status to available. Checks if there is any reservation on the item, then system notifies that member about the book being available.
Same way one can comeup with the reserve an item activity.
Now time to look into actual code, this is a work in progress and will be done gradually and improved upon :
No comments:
Post a Comment