One way to do it could use the bridge pattern, and instantiate the "mover engine" at the last minute.
PROCEDURE Init
DO CASE
CASE This.VehicleType = "PLANE"
This.oMover = CREATEOBJECT("PlaneMover")
CASE This.VehicleType = "CAR"
This.oMover = CREATEOBJECT("CarMover")
Etc.
Etc.
ENDPROC
PROCEDURE Move
This.oMover.Do()
ENDPROC
Init probably wouldn't be a good place for that, because it doesn't give This.VehicleType time to be set, but you get the idea. I have found it most useful to send an object handle "across the bridge" to facilitate two way communication. So it would be:
This.oMover = CREATEOBJECT("PlaneMover")
This.oMover.ParentHandle = This
Or, you could do it with parameters. I've been trying to avoid parameters lately.
Marty
Marty Smith, CSQE