vendredi 12 avril 2019

Composite Pattern and can it be used for DailyPay (leaf) and PayPeriod (Composite)?

As I am fairly new to design patterns and trying to implement some of them in my personal projects I am confused if the composite pattern is applicable for my use. I am attempting to calculate pay for a single day and store it in a pay period. DailyPay is my 'leaf' and PayPeriod my 'composite'.

Does it even make sense to do this? In this scenario, I am calculating pay for tractor-trailer drivers who are paid per stop, mileage, and trailers drop. Then attempting to keep track of 7 days of pay and calculate the weekly pay and then monthly.

Aucun commentaire:

Enregistrer un commentaire