quiz icon indicating copy to clipboard operation
quiz copied to clipboard

Document Class Refactoring

Open ASalman opened this issue 10 years ago • 0 comments

I assumed that this test is focusing on the design more than statements (like sql ones), and I found the following issues on the design of classes:
1- There are redundant code between getTitle and getContent functions and they are getters functions 2- There are two hard coded values to access array values, so I changed them to consts 3- init function in document class is very risky, if the developer forget to call it all other functions will not do the expected behavior 4- We should unify the way we are using the object, so I see there is a deference between getting one object of document and multiple objects 5- in user class 'makeNewDocument' function is confusing, I expect it to make a new document not fetch a document 6- getMyDocuments in user class is doing some logic that should be done on document class That's all, I enjoyed it and looking forward to hear your feedback

ASalman avatar Feb 20 '16 22:02 ASalman