At the end of a flow of operations, there is a printing module that gathers data from the various sources involved (Customer, Order Header, Order Content, User, Payment, ...) to build a summary receipt or report printout. What should be the appropriate pattern in order to pass data to this module ?
In the existing code, data are passed such as :
Print print = new Print();
// then a very long list of info
print.PaymentInfo1 = ...;
print.PaymentInfo2 = ...;
print.CustomerInfo1 = ...;
...
// Then I print
print.PrintReceipt();
The idea is to gather the various object in one entity. I have seen the Composite Pattern, the Facade and the Module Pattern. What pattern is the best adapted ?
I was thinking instead about something like :
Print print = new Print();
// then only the sources involved
print.AddPayment(currPayment);
print.AddCustomer(currCustomer);
...
// Then I print
print.PrintReceipt();