I need to write application in that I have calculation like this:
In this I need to configure that tell us to include or not the Sales tax and service tax. Finally I need to Item wise amounts AS Basic Fee, Registration Fee, Sales tax and Service tax.
What design pattern I have to use to achieve this?
I have confusion on Decorator and Chain-of-Responsibility. and on each thing I have to store there respective fee. at the end. need list as
Desc Basic Reg Sales Service Total
------------------------------------------
Item 1 100 25 22 13 160
Item 2 80 15 12 8 115
------------------------------------------
Total 180 40 34 25 275
I believe decorator pattern should fits your requirements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With