Last wed, our Machine Problem (mp) specification was distributed. We were tasked to create a library application that allows the user to add, borrow, and view books. The constraints were if the book to be added already exist the system,we just need to add its quantity. In borrowing books, the user can borrow any book as long as there are still copies of the book. Aside from that, they can not borrow during the weekends. The available and borrowed books will be stored in the text file.
We have to finish the mp individually within 2 days and the code review shall follow next. First, I listed down all the functions of the system. I also listed down the classes that I needed and how would they interact with each other. It was a little difficult because our design should follow the principles of a good OO program. We also need to take note of the best practices. Finally, I decided to have 5 classes interacting with each other. They are Book, Borrowed Book, LibraryFile, LibraryOperation, and the main Library. LibraryFile shall handle the opening and writing of files. While LibraryOperation handles the add and borrow operations of the library.
The judgment day came. Our codes were be reviewed by critiques. There were mistakes in my design. First, some classes were overworked. They had to handle many matters. Second, I lack more unit test. Third, there were some best practices that I forgot to implement. Also I forgot to refactor some parts of the codes.
We have to finish the mp individually within 2 days and the code review shall follow next. First, I listed down all the functions of the system. I also listed down the classes that I needed and how would they interact with each other. It was a little difficult because our design should follow the principles of a good OO program. We also need to take note of the best practices. Finally, I decided to have 5 classes interacting with each other. They are Book, Borrowed Book, LibraryFile, LibraryOperation, and the main Library. LibraryFile shall handle the opening and writing of files. While LibraryOperation handles the add and borrow operations of the library.
The judgment day came. Our codes were be reviewed by critiques. There were mistakes in my design. First, some classes were overworked. They had to handle many matters. Second, I lack more unit test. Third, there were some best practices that I forgot to implement. Also I forgot to refactor some parts of the codes.
Leave a comment
