🗼 EIFFEL CONTRACT DIFFICULTY: Apprentice Behavioral

The Iterator Dowsing Rod

Traversing collections of magical artifacts sequentially.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Iterator
ARCANUM SCHOOL: Divination // Dowsing
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
deferred class
    ARTIFACT_ITERATOR [G]

feature
    item: G
        deferred
        end

    forth
        deferred
        end

    after: BOOLEAN
        deferred
        end
end

Using an Iterator, one can scan through a vault of artifacts blindly, relying on strict contracts to prevent exceeding the bounds of the collection.

Runic Tags: #behavioral #iterator #eiffel