Skip to content
Snippets Groups Projects
Commit 0af9af74 authored by Bassel Dib's avatar Bassel Dib
Browse files

Add new file

parent b6f77675
No related branches found
No related tags found
No related merge requests found
Readme 0 → 100644
General note: all methods are described with comments other than Constructers, getters and replicated methods (in Article class)
References:
- Java Documentation Oracle
• String
• Time.localdate
• Objects and classes
• Reflection
- YouTube (mainly Coding with John)
- Stack overflow.
First thoughts
- I need some kind of memory and that couldn’t only be provided with objects
o Arraylist
- To mark books as liked my first idea was to use Boolean to mark the books if liked or not, but it was not later feasible with OOP and the following use for customer and getAllLikedBooks
o Store liked books in a list for each customer and increase number of likes for a book
Most liked books: first I implemented a method that returns the most liked book
 Problem: if two books has same count it returns only one
 Solution: a second method that gets all the books that has same likeCount as mostLikedBook
 Problem: if no books were liked it still returns a book with 0 likes
 (primitive) solution: if no books were liked return null
Difficulties: Repetition in writing same methods for articles and books and for read and likes
 Is there more efficient implementation to avoid duplicated methods?
Extension and interfaces?
Possible improvements:
- Add explanatory text to the (Boolean) returns
- More exception handling
- More efficient implementation of duplicated methods as described above
-
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment