GRASP: Applying the default Creator

2

Craig Larman ( Using UML and Patterns on page 352) proposes the following design problem:

  

Who is responsible for creating a Payment instance?

By default GRASP Creator, the candidates are the Registrar class and the Sell class.

In the case of the Sale class, he justifies that he is a candidate for being "reasonable to think that he uses Payment next" .

I could not understand where he got it from. I thought of two possibilities:

  • After a Full Sale comes a Payment.

  • After a Payment will be refunded, and the calculation of that change comes from the difference between the total Sale and the amount provided in the Payment.

  • Is there any more relationship between Sale and Payment that I can not see?

        
    asked by anonymous 16.07.2018 / 00:55

    0 answers