August 2003
Intermediate to advanced
736 pages
14h 48m
English
Once upon a time, in a strange land south of here, lived Peter. Peter was a diligent worker who would readily accept requests from his boss. However, his boss was a mean, untrusting man who insisted on steady progress reports. Because Peter did not want his boss standing in his office looking over his shoulder, Peter promised to notify his boss whenever his work progressed. Peter implemented this promise by periodically calling his boss back via a typed reference like so:
class Worker {
public void Advise(Boss boss) {this.boss = boss; }
public void DoWork() {
Console.WriteLine("Worker: work started");
if( boss != null ) boss.WorkStarted();
Console.WriteLine("Worker: work progressing");
if( boss != null ) boss.WorkProgressing(); Console.WriteLine("Worker: ...Read now
Unlock full access