Skip to content
Definition
After identifying components, it is crucial to determine the sequence in which steps should be executed, considering dependencies between subprocedures.
Key Point
Sequencing ruleWhy it matters
Respect dependenciesSome tasks require earlier outputs (e.g. ISBN before stock check)
Parallelise where possibleIndependent tasks can run simultaneously
Validate input earlyPrevents invalid data flowing through later stages
Authenticate before privileged actionsProtects security and user-specific operations
Worked Example
Worked Example: Book Reservation System Flow
pseudocode
// Sequential steps (dependencies exist)
procedure makeReservation():
    // Step 1: User must sign in first
    userID = authenticateUser()
    if userID is null then
        print("Please sign in")
        return
    end if
    
    // Step 2: Get book details
    bookTitle = input("Enter book title: ")
    ISBN = getBookISBN(bookTitle)
    
    // Step 3: Check availability (depends on ISBN)
    if NOT checkAvailability(ISBN) then
        print("Book not available")
        return
    end if
    
    // Step 4: Select location (depends on book being available)
    location = selectLocation()
    
    // Step 5: Confirm (depends on all previous steps)
    confirmReservation(userID, ISBN, location)
end procedure
Step Dependencies:
Step orderDependency reason
User auth → Book selectionMust know who is reserving before creating reservation
Book selection → Availability checkNeed ISBN/book first to check stock
Availability check → LocationOnly ask for pickup location if book is available
Location → ConfirmationFinal record requires all previous values
Wrong-order examples:
• Checking availability before selecting a book fails
• Confirming before authentication creates security risks