educative.io

Educative

makeTransaction fuction : Appropriate class

Dear Educative,
There is function in ATM class:
public boolean makeTransaction(Customer customer, Transaction transaction);
There can be another approach of creating an object of transaction class in ATM and makeTransaction function will lie in Transaction class.

  1. Please let us know what are the pros and cons of the two designs.
  2. What should be criterion for selecting one out of two designs i.e how to justify your selection.