educative.io

Educative

Why have been so much logic encapsulated within Member class

I see the method of bookRenew. It does following operations.

  1. Update BookReservation status(COMPLETED/RESERVED)
  2. Do the book lending
  3. Publish out book available notification.
    Should this much logic reside in the member class. I think there should be a manager class that holds the responsibility of managing all the tasks required for renewal of book and each class should hold the logic of doing that operation. For eg. book class should only have the logic of updating the status of book. With increasing functionalities member class might bloat up.
2 Likes