Scenario
Calendar
add(
Appointment
):void
appointments:Appointment[]
REGULAR:int
TODO:int
ALLDAY:int
*
Encapsulate Parameters
Appointment
date:Date
start:Time
end:Time
desc:String
type:int
appointments
Now that we have an Appointment class, it makes sense to replace the multiple parameters to add() with a single Appointment parameter.
The user does this with the encapsulate parameters refactoring.
Since Dr. Jones knows where the add() method is called in the original program, it can tell the programmer where to change the calling syntax later.