CURRENT ISSUE Contests
Feature Article
|
|
Issue #212 March 2008
LESSONS FROM THE TRENCHES
Do You Want to Do a Design?
Linked Lists
by George Martin
Start | Design Challenge | Database Design | Use A Linked List | Design Implementation | Code Review | Sources & PDF
LISTING 1
Listing 1—This is pseudocode of the problem of dialing out.
Detect a problem. If the problem has not been reported and acknowledged Try to get Outgoing Line If Successful Dial 1st Number Wait for connection Send Message Wait for Acknowledge If Acknowledge is received Mark problem as reported and acknowledged Else Dial 2nd number Wait for connection Send Message Wait for Acknowledge If Acknowledge is received Mark problem as reported and acknowledged Else Dial 3rd number Wait for connection Send Message Wait for Acknowledge If Acknowledge is received Mark problem as reported and acknowledged Else Dial 4th number Wait for connection Send Message Wait for Acknowledge If Acknowledge is received Mark problem as reported and acknowledged If not acknowledged Repeat the above process N times Once problem is acknowledged mark it as reported. When Problem goes away clear the reported flag.