🗼 EIFFEL CONTRACT DIFFICULTY: Adept Creational

The Abstract Factory Ward

Forging interconnected wards through a common interface pact.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Abstract Factory
ARCANUM SCHOOL: Conjuration // Pact-making
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// EIFFEL PATTERN //
deferred class
    ABSTRACT_WARD_FACTORY

feature -- Factory

    create_offensive_ward: OFFENSIVE_WARD
        deferred
        ensure
            ward_forged: Result /= Void
        end

    create_defensive_ward: DEFENSIVE_WARD
        deferred
        ensure
            ward_forged: Result /= Void
        end

end

The Abstract Factory ensures that intertwined arcane wards are always created in matching pairs, bound by an unbreakable Design by Contract pact.

Runic Tags: #creational #factories #contracts #eiffel