in reply to OO design: abstract class or can()?

I frequently use can() as a means to extend behavior in just one or two isolated spaces, so it doesn't seem at all evil to me. If I find myself using can() too frequently, though, I take that as a sign that it's probably time to rethink the code.

I prefer that my inheritance tree go from the most generic to the most application specific, so inheriting from a class whose method(s) will only be used while the wind is out of the south on leap day if it's Tuesday and the moon is new seems much closer to evil than can().

  • Comment on Re: OO design: abstract class or can()?