+1

Adapter Pseudo code - peg.radius()

Jugesh Sundram 4 years ago updated by mortaza kolahi 4 years ago 0

https://refactoring.guru/design-patterns/adapter

class RoundHole is
    constructor RoundHole(radius) { ... }

    method getRadius() is
        // Return the radius of the hole.

    method fits(peg: RoundPeg) is
        return this.getRadius() >= peg.radius()


Shouldn't peg.radius() be peg.getRadius()?