Using Abstractions in Design
Seeing Abstractions
Throughout this course, we have been realizing the detailed design for the pieces of the whole picture we started with at the beginning of the course. We have built many abstractions, so let's go back and document what we have found and see the abstractions we have created.
(This is a chart)
Abstraction Name-calculateSubtotal
Parameter List -(totalPurchaseAmount :double,
salesTaxRate : double)
Scope/Purpose-Applies sales tax and computes the final amount due
Refactoring
Sometimes it is easy to see how the whole solution can be broken into pieces, and other times it is done as you see abstractions and opportunities for reuse in the resulting design. This is called refactoring. For the pseudocode you see below, look for abstractions you could create and create a flowchart using your simplifications.